aioway 0.2__tar.gz → 0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. {aioway-0.2 → aioway-0.3}/.github/workflows/pre-commit.yaml +18 -10
  2. {aioway-0.2 → aioway-0.3}/.github/workflows/publish.yaml +7 -4
  3. {aioway-0.2 → aioway-0.3}/.github/workflows/unit-test.yaml +16 -8
  4. {aioway-0.2 → aioway-0.3}/.github/workflows/website.yaml +8 -6
  5. {aioway-0.2 → aioway-0.3}/CONTRIBUTING.md +11 -7
  6. aioway-0.3/Makefile +71 -0
  7. {aioway-0.2/src/aioway.egg-info → aioway-0.3}/PKG-INFO +2 -3
  8. aioway-0.3/ci/cleanup-github.sh +18 -0
  9. aioway-0.3/ci/docs.sh +10 -0
  10. aioway-0.3/ci/echo-run.sh +5 -0
  11. aioway-0.3/ci/group-actions.py +50 -0
  12. aioway-0.3/ci/install-linux.sh +8 -0
  13. aioway-0.3/ci/install-mac.sh +9 -0
  14. aioway-0.3/notebooks/deductor_for_instrs.py +42 -0
  15. {aioway-0.2 → aioway-0.3}/notebooks/mnist.py +3 -2
  16. {aioway-0.2 → aioway-0.3}/pdm.lock +78 -250
  17. {aioway-0.2 → aioway-0.3}/pyproject.toml +1 -4
  18. {aioway-0.2 → aioway-0.3}/src/aioway/__init__.py +2 -1
  19. aioway-0.3/src/aioway/_utils/signs.py +160 -0
  20. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/typing.py +10 -0
  21. {aioway-0.2 → aioway-0.3}/src/aioway/app/entrypoint.py +6 -5
  22. {aioway-0.2 → aioway-0.3}/src/aioway/app/server.py +15 -8
  23. aioway-0.3/src/aioway/compilers/__init__.py +4 -0
  24. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers}/emits/__init__.py +1 -0
  25. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers}/emits/convs.py +25 -18
  26. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers}/emits/emitters.py +8 -38
  27. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers}/emits/linear.py +30 -59
  28. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers/emits}/losses/contrastive.py +1 -24
  29. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers}/emits/norms.py +8 -21
  30. aioway-0.3/src/aioway/compilers/rewrites.py +17 -0
  31. {aioway-0.2 → aioway-0.3}/src/aioway/dsets/comps.py +2 -2
  32. aioway-0.3/src/aioway/instrs/__init__.py +11 -0
  33. aioway-0.3/src/aioway/instrs/containers.py +57 -0
  34. aioway-0.3/src/aioway/instrs/deducts.py +235 -0
  35. aioway-0.3/src/aioway/instrs/instrs.py +128 -0
  36. aioway-0.3/src/aioway/instrs/layers/README.md +7 -0
  37. aioway-0.3/src/aioway/instrs/layers/__init__.py +8 -0
  38. aioway-0.3/src/aioway/instrs/layers/actives.py +87 -0
  39. aioway-0.3/src/aioway/instrs/layers/dense.py +139 -0
  40. aioway-0.3/src/aioway/instrs/layers/dropouts.py +63 -0
  41. aioway-0.3/src/aioway/instrs/layers/embs.py +51 -0
  42. aioway-0.3/src/aioway/instrs/layers/norms.py +90 -0
  43. aioway-0.3/src/aioway/instrs/layers/sliding.py +263 -0
  44. aioway-0.3/src/aioway/instrs/losses.py +134 -0
  45. aioway-0.3/src/aioway/instrs/nn.py +43 -0
  46. aioway-0.3/src/aioway/instrs/rl.py +67 -0
  47. {aioway-0.2 → aioway-0.3}/src/aioway/trainers/__init__.py +1 -0
  48. {aioway-0.2 → aioway-0.3}/src/aioway/trainers/nmf.py +1 -30
  49. {aioway-0.2 → aioway-0.3}/src/aioway/trainers/static.py +12 -39
  50. aioway-0.3/src/aioway/trainers/steps.py +141 -0
  51. {aioway-0.2 → aioway-0.3}/src/aioway/tspecs/__init__.py +2 -1
  52. aioway-0.3/src/aioway/tspecs/composed.py +38 -0
  53. {aioway-0.2 → aioway-0.3}/src/aioway/tspecs/tspecs.py +44 -3
  54. aioway-0.3/src/aioway/tspecs/utils.py +34 -0
  55. {aioway-0.2 → aioway-0.3/src/aioway.egg-info}/PKG-INFO +2 -3
  56. {aioway-0.2 → aioway-0.3}/src/aioway.egg-info/SOURCES.txt +45 -18
  57. {aioway-0.2 → aioway-0.3}/src/aioway.egg-info/requires.txt +1 -2
  58. {aioway-0.2 → aioway-0.3}/src/aioway.egg-info/scm_file_list.json +45 -18
  59. aioway-0.3/src/aioway.egg-info/scm_version.json +8 -0
  60. aioway-0.3/tests/_utils/test_signs.py +50 -0
  61. {aioway-0.2/tests/nets → aioway-0.3/tests/compilers/emits}/test_compound.py +1 -1
  62. {aioway-0.2/tests/nets → aioway-0.3/tests/compilers/emits}/test_convs.py +12 -6
  63. {aioway-0.2/tests/nets → aioway-0.3/tests/compilers/emits}/test_linear.py +12 -24
  64. {aioway-0.2/tests/nets → aioway-0.3/tests/compilers/emits}/test_norms.py +2 -15
  65. aioway-0.3/tests/instrs/test_deducts.py +72 -0
  66. aioway-0.3/tests/instrs/test_losses.py +20 -0
  67. aioway-0.3/tests/losses/test_contrastive.py +17 -0
  68. {aioway-0.2 → aioway-0.3}/tests/losses/test_losses.py +1 -1
  69. aioway-0.3/tests/tspecs/test_types.py +48 -0
  70. aioway-0.2/noxfile.py +0 -409
  71. aioway-0.2/src/aioway/_utils/signs.py +0 -80
  72. aioway-0.2/src/aioway/emits/_utils.py +0 -38
  73. aioway-0.2/src/aioway/tspecs/casts.py +0 -123
  74. aioway-0.2/src/aioway.egg-info/scm_version.json +0 -8
  75. aioway-0.2/tests/losses/test_contrastive.py +0 -35
  76. aioway-0.2/tests/trainers/test_nmf.py +0 -21
  77. aioway-0.2/tests/tspecs/test_types.py +0 -41
  78. {aioway-0.2 → aioway-0.3}/.gitattributes +0 -0
  79. {aioway-0.2 → aioway-0.3}/.gitignore +0 -0
  80. {aioway-0.2 → aioway-0.3}/CITATIONS.cff +0 -0
  81. {aioway-0.2 → aioway-0.3}/CODEOWNERS +0 -0
  82. {aioway-0.2 → aioway-0.3}/CODE_OF_CONDUCT.md +0 -0
  83. {aioway-0.2 → aioway-0.3}/LICENSE.md +0 -0
  84. {aioway-0.2 → aioway-0.3}/README.md +0 -0
  85. {aioway-0.2 → aioway-0.3}/assets/architecture.excalidraw +0 -0
  86. {aioway-0.2 → aioway-0.3}/assets/architecture.svg +0 -0
  87. {aioway-0.2 → aioway-0.3}/docs/.nojekyll +0 -0
  88. {aioway-0.2 → aioway-0.3}/docs/CNAME +0 -0
  89. {aioway-0.2 → aioway-0.3}/docs/Makefile +0 -0
  90. {aioway-0.2 → aioway-0.3}/docs/README.md +0 -0
  91. {aioway-0.2 → aioway-0.3}/docs/_coverpage.md +0 -0
  92. {aioway-0.2 → aioway-0.3}/docs/coverpage.css +0 -0
  93. {aioway-0.2 → aioway-0.3}/docs/dev/conf.py +0 -0
  94. {aioway-0.2 → aioway-0.3}/docs/dev/index.md +0 -0
  95. {aioway-0.2 → aioway-0.3}/docs/dev/index.rst +0 -0
  96. {aioway-0.2 → aioway-0.3}/docs/index.html +0 -0
  97. {aioway-0.2 → aioway-0.3}/media/.gitkeep +0 -0
  98. {aioway-0.2 → aioway-0.3}/media/file_example_JPG_2500kB.jpg +0 -0
  99. {aioway-0.2 → aioway-0.3}/media/file_example_MP3_5MG.mp3 +0 -0
  100. {aioway-0.2 → aioway-0.3}/media/file_example_MP4_1920_18MG.mp4 +0 -0
  101. {aioway-0.2 → aioway-0.3}/media/file_example_PNG_3MB.png +0 -0
  102. {aioway-0.2 → aioway-0.3}/media/in_search_of_lost_time.txt +0 -0
  103. {aioway-0.2 → aioway-0.3}/notebooks/aten.py +0 -0
  104. {aioway-0.2 → aioway-0.3}/notebooks/attributes.py +0 -0
  105. {aioway-0.2 → aioway-0.3}/notebooks/disable_ops.py +0 -0
  106. {aioway-0.2 → aioway-0.3}/notebooks/grads.py +0 -0
  107. {aioway-0.2 → aioway-0.3}/notebooks/hello.py +0 -0
  108. {aioway-0.2 → aioway-0.3}/notebooks/missing_values.py +0 -0
  109. {aioway-0.2 → aioway-0.3}/notebooks/print_torch_ops.py +0 -0
  110. {aioway-0.2 → aioway-0.3}/notebooks/state_dicts.py +0 -0
  111. {aioway-0.2 → aioway-0.3}/setup.cfg +0 -0
  112. {aioway-0.2 → aioway-0.3}/src/aioway/_api/__init__.py +0 -0
  113. {aioway-0.2 → aioway-0.3}/src/aioway/_api/fast.py +0 -0
  114. {aioway-0.2 → aioway-0.3}/src/aioway/_api/items.py +0 -0
  115. {aioway-0.2 → aioway-0.3}/src/aioway/_costs.py +0 -0
  116. {aioway-0.2 → aioway-0.3}/src/aioway/_modules.py +0 -0
  117. {aioway-0.2 → aioway-0.3}/src/aioway/_sess.py +0 -0
  118. {aioway-0.2 → aioway-0.3}/src/aioway/_thunks.py +0 -0
  119. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/__init__.py +0 -0
  120. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/dags.py +0 -0
  121. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/decomps.py +0 -0
  122. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/hooks.py +0 -0
  123. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/logging.py +0 -0
  124. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/platforms.py +0 -0
  125. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/profs.py +0 -0
  126. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/renders.py +0 -0
  127. {aioway-0.2 → aioway-0.3}/src/aioway/_utils/types.py +0 -0
  128. {aioway-0.2 → aioway-0.3}/src/aioway/api.py +0 -0
  129. {aioway-0.2 → aioway-0.3}/src/aioway/app/__init__.py +0 -0
  130. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/__init__.py +0 -0
  131. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/_av.py +0 -0
  132. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/_bases.py +0 -0
  133. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/audios.py +0 -0
  134. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/collates.py +0 -0
  135. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/images.py +0 -0
  136. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/texts.py +0 -0
  137. {aioway-0.2 → aioway-0.3}/src/aioway/codecs/videos.py +0 -0
  138. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers}/emits/compound.py +0 -0
  139. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers/emits}/losses/__init__.py +0 -0
  140. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers/emits}/losses/losses.py +0 -0
  141. {aioway-0.2/src/aioway → aioway-0.3/src/aioway/compilers/emits}/losses/recon.py +0 -0
  142. {aioway-0.2 → aioway-0.3}/src/aioway/dsets/__init__.py +0 -0
  143. {aioway-0.2 → aioway-0.3}/src/aioway/dsets/discovery.py +0 -0
  144. {aioway-0.2 → aioway-0.3}/src/aioway/dsets/dsets.py +0 -0
  145. {aioway-0.2 → aioway-0.3}/src/aioway/dsets/mnist.py +0 -0
  146. {aioway-0.2 → aioway-0.3}/src/aioway/errors/__init__.py +0 -0
  147. {aioway-0.2 → aioway-0.3}/src/aioway/errors/exceptions.py +0 -0
  148. {aioway-0.2 → aioway-0.3}/src/aioway/errors/raising.py +0 -0
  149. {aioway-0.2 → aioway-0.3}/src/aioway/modes/README.md +0 -0
  150. {aioway-0.2 → aioway-0.3}/src/aioway/modes/__init__.py +0 -0
  151. {aioway-0.2 → aioway-0.3}/src/aioway/modes/aten/README.md +0 -0
  152. {aioway-0.2 → aioway-0.3}/src/aioway/modes/aten/__init__.py +0 -0
  153. {aioway-0.2 → aioway-0.3}/src/aioway/modes/aten/aten.py +0 -0
  154. {aioway-0.2 → aioway-0.3}/src/aioway/modes/aten/binary.py +0 -0
  155. {aioway-0.2 → aioway-0.3}/src/aioway/modes/aten/fn.py +0 -0
  156. {aioway-0.2 → aioway-0.3}/src/aioway/modes/aten/getitem.py +0 -0
  157. {aioway-0.2 → aioway-0.3}/src/aioway/modes/aten/guards.py +0 -0
  158. {aioway-0.2 → aioway-0.3}/src/aioway/modes/fake.py +0 -0
  159. {aioway-0.2 → aioway-0.3}/src/aioway/modes/hists.py +0 -0
  160. {aioway-0.2 → aioway-0.3}/src/aioway/modes/modes.py +0 -0
  161. {aioway-0.2 → aioway-0.3}/src/aioway/modes/toggles.py +0 -0
  162. {aioway-0.2 → aioway-0.3}/src/aioway/modes/tracking.py +0 -0
  163. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/README.md +0 -0
  164. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/__init__.py +0 -0
  165. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/_bases.py +0 -0
  166. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/attrs.py +0 -0
  167. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/devices.py +0 -0
  168. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/dtypes.py +0 -0
  169. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/layouts.py +0 -0
  170. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/modules.py +0 -0
  171. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/renders.py +0 -0
  172. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/schemas.py +0 -0
  173. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/shapes.py +0 -0
  174. {aioway-0.2 → aioway-0.3}/src/aioway/schemas/utils.py +0 -0
  175. {aioway-0.2 → aioway-0.3}/src/aioway/trainers/rl.py +0 -0
  176. {aioway-0.2 → aioway-0.3}/src/aioway/tspecs/README.md +0 -0
  177. {aioway-0.2 → aioway-0.3}/src/aioway/tspecs/gym.py +0 -0
  178. {aioway-0.2 → aioway-0.3}/src/aioway/tspecs/media.py +0 -0
  179. {aioway-0.2 → aioway-0.3}/src/aioway.egg-info/dependency_links.txt +0 -0
  180. {aioway-0.2 → aioway-0.3}/src/aioway.egg-info/top_level.txt +0 -0
  181. {aioway-0.2 → aioway-0.3}/tests/__init__.py +0 -0
  182. {aioway-0.2 → aioway-0.3}/tests/_utils/test_dags.py +0 -0
  183. {aioway-0.2 → aioway-0.3}/tests/_utils/test_decomps.py +0 -0
  184. {aioway-0.2 → aioway-0.3}/tests/_utils/test_types.py +0 -0
  185. {aioway-0.2 → aioway-0.3}/tests/codecs/conftest.py +0 -0
  186. {aioway-0.2 → aioway-0.3}/tests/codecs/test_audios.py +0 -0
  187. {aioway-0.2 → aioway-0.3}/tests/codecs/test_collate.py +0 -0
  188. {aioway-0.2 → aioway-0.3}/tests/codecs/test_images.py +0 -0
  189. {aioway-0.2 → aioway-0.3}/tests/codecs/test_media.py +0 -0
  190. {aioway-0.2 → aioway-0.3}/tests/codecs/test_texts.py +0 -0
  191. {aioway-0.2 → aioway-0.3}/tests/codecs/test_videos.py +0 -0
  192. {aioway-0.2 → aioway-0.3}/tests/conftest.py +0 -0
  193. {aioway-0.2 → aioway-0.3}/tests/mock.py +0 -0
  194. {aioway-0.2 → aioway-0.3}/tests/modes/test_fate.py +0 -0
  195. {aioway-0.2 → aioway-0.3}/tests/modes/test_history.py +0 -0
  196. {aioway-0.2 → aioway-0.3}/tests/modes/test_thunks.py +0 -0
  197. {aioway-0.2 → aioway-0.3}/tests/schemas/test_devices.py +0 -0
  198. {aioway-0.2 → aioway-0.3}/tests/schemas/test_dtypes.py +0 -0
  199. {aioway-0.2 → aioway-0.3}/tests/schemas/test_layouts.py +0 -0
  200. {aioway-0.2 → aioway-0.3}/tests/schemas/test_modules.py +0 -0
  201. {aioway-0.2 → aioway-0.3}/tests/schemas/test_shapes.py +0 -0
  202. {aioway-0.2 → aioway-0.3}/tests/test_api.py +0 -0
  203. {aioway-0.2 → aioway-0.3}/tests/test_ci.py +0 -0
  204. {aioway-0.2 → aioway-0.3}/tests/test_costs.py +0 -0
  205. {aioway-0.2 → aioway-0.3}/tests/test_mock.py +0 -0
  206. {aioway-0.2 → aioway-0.3}/tests/test_modules.py +0 -0
  207. {aioway-0.2 → aioway-0.3}/tests/test_notebooks.py +0 -0
  208. {aioway-0.2 → aioway-0.3}/tests/test_sess.py +0 -0
  209. {aioway-0.2 → aioway-0.3}/tests/tspecs/test_gym.py +0 -0
@@ -4,31 +4,39 @@ jobs:
4
4
  format:
5
5
  name: 📑 Formatting
6
6
  runs-on: ubuntu-latest
7
+ strategy:
8
+ matrix:
9
+ python-version: ["3.14"]
10
+
7
11
  steps:
8
12
  - name: 🔔 Check out
9
13
  uses: actions/checkout@v3
10
14
 
11
15
  - name: ⬇️ Python PDM
12
16
  uses: pdm-project/setup-pdm@v4
17
+ with:
18
+ python-version: ${{ matrix.python-version }}
19
+ cache: true
13
20
 
14
- - name: 💣 Prepare
15
- run: pip install nox[pbs] && nox -rs setup
16
-
17
- - name: 🏃 Formatting
18
- run: nox -rs format_check
21
+ - name: 🪄 Formatting
22
+ run: make setup install autoflake isort black CHECK=1
19
23
 
20
24
  type:
21
25
  name: 👨‍⚕️ Type Checking
22
26
  runs-on: ubuntu-latest
27
+ strategy:
28
+ matrix:
29
+ python-version: ["3.14"]
30
+
23
31
  steps:
24
32
  - name: 🔔 Check out
25
33
  uses: actions/checkout@v3
26
34
 
27
35
  - name: ⬇️ Python PDM
28
36
  uses: pdm-project/setup-pdm@v4
37
+ with:
38
+ python-version: ${{ matrix.python-version }}
39
+ cache: true
29
40
 
30
- - name: 💣 Prepare
31
- run: pip install nox[pbs] && nox -rs setup
32
-
33
- - name: 🏃 Type checking
34
- run: nox -rs type
41
+ - name: ⌨️ Type checking
42
+ run: make setup install mypy
@@ -12,6 +12,9 @@ jobs:
12
12
  permissions:
13
13
  contents: read
14
14
  id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.14"]
15
18
 
16
19
  steps:
17
20
  - name: 🔔 Check out
@@ -19,9 +22,9 @@ jobs:
19
22
 
20
23
  - name: ⬇️ Python PDM
21
24
  uses: pdm-project/setup-pdm@v4
22
-
23
- - name: 💣 Prepare
24
- run: pip install nox[pbs] && nox -rs setup
25
+ with:
26
+ python-version: ${{ matrix.python-version }}
27
+ cache: true
25
28
 
26
29
  - name: 📦 Release
27
- run: nox -rs publish
30
+ run: make setup install publish
@@ -4,6 +4,10 @@ jobs:
4
4
  unit-test:
5
5
  name: 🧪 Unit Testing
6
6
  runs-on: ubuntu-latest
7
+ strategy:
8
+ matrix:
9
+ python-version: ["3.14"]
10
+
7
11
  steps:
8
12
  - name: 🔔 Check out
9
13
  uses: actions/checkout@v3
@@ -12,25 +16,29 @@ jobs:
12
16
 
13
17
  - name: ⬇️ Python PDM
14
18
  uses: pdm-project/setup-pdm@v4
15
-
16
- - name: 💣 Prepare
17
- run: pip install nox[pbs] && nox -rs setup
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ cache: true
18
22
 
19
23
  - name: 🧪 Test with pytest
20
- run: nox -rs test
24
+ run: make setup install pytest
21
25
 
22
26
  build:
23
27
  name: 👷 Build
24
28
  runs-on: ubuntu-latest
29
+ strategy:
30
+ matrix:
31
+ python-version: ["3.14"]
32
+
25
33
  steps:
26
34
  - name: 🔔 Check out
27
35
  uses: actions/checkout@v3
28
36
 
29
37
  - name: ⬇️ Python PDM
30
38
  uses: pdm-project/setup-pdm@v4
31
-
32
- - name: 💣 Prepare
33
- run: pip install nox[pbs] && nox -rs setup
39
+ with:
40
+ python-version: ${{ matrix.python-version }}
41
+ cache: true
34
42
 
35
43
  - name: 👷‍♂️ Build
36
- run: nox -rs build
44
+ run: make setup install build
@@ -5,20 +5,22 @@ jobs:
5
5
  docs:
6
6
  name: 📚 Docs
7
7
  runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.14"]
11
+
8
12
  steps:
9
13
  - name: 🔔 Check out
10
14
  uses: actions/checkout@v3
11
- with:
12
- lfs: true
13
15
 
14
16
  - name: ⬇️ Python PDM
15
17
  uses: pdm-project/setup-pdm@v4
16
-
17
- - name: 💣 Prepare
18
- run: pip install nox[pbs] && nox -rs setup
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ cache: true
19
21
 
20
22
  - name: 📚 Build docs
21
- run: nox -rs docs
23
+ run: make setup install docs
22
24
 
23
25
  - name: 📦 Upload site
24
26
  uses: actions/upload-pages-artifact@v3
@@ -33,33 +33,37 @@ Then activate with
33
33
  eval $(pdm venv activate)
34
34
  ```
35
35
 
36
+ or simpler, if you want to use our makefile:
37
+
38
+ ```bash
39
+ make setup install
40
+ ```
41
+
36
42
  To run testing, do:
37
43
 
38
44
  ```bash
39
- nox -s test
45
+ make pytest
40
46
  ```
41
47
 
42
48
  To format the codebase, run:
43
49
 
44
50
  ```bash
45
- nox -s format
51
+ make autoflake isort black
46
52
  ```
47
53
 
48
54
  To just check the formatting (no modification), run:
49
55
 
50
56
  ```bash
51
- nox -s format_check
57
+ make autoflake isort black CHECK=1
52
58
  ```
53
59
 
54
60
  To run type checking with `mypy`, run:
55
61
 
56
62
  ```bash
57
- nox -s type
63
+ make mypy
58
64
  ```
59
65
 
60
- `format`, `type`, `test` are checked in github actions, and they are required for merging.
61
-
62
- Run `nox -l` for all options defined in the project.
66
+ These make commands are executed in github actions, see `.github/workflows` for details.
63
67
 
64
68
  ## Recommended development style
65
69
 
aioway-0.3/Makefile ADDED
@@ -0,0 +1,71 @@
1
+ # Copyright (c) AIoWay Authors - All Rights Reserved
2
+
3
+
4
+ OS := $(shell uname -s)
5
+ PYTEST_FLAGS :=
6
+ PYTHON_VERSION :=
7
+ CHECK :=
8
+ CHECK_FLAG := $(if $(CHECK),--check,)
9
+ SUDO := sudo -E
10
+
11
+ # Running in GitHub Actions
12
+ ifeq ($(GITHUB_ACTIONS),true)
13
+ SH := python3 ci/group-actions.py
14
+ CLEANUP := $(SUDO) $(SH) bash ci/cleanup-github.sh
15
+ # Running locally
16
+ else
17
+ SH := bash ci/echo-run.sh
18
+ CLEANUP :=
19
+ endif
20
+
21
+
22
+ setup: cleanup deps
23
+
24
+ cleanup:
25
+ $(CLEANUP)
26
+
27
+ deps:
28
+ @echo "Installing dependencies for $(OS)"
29
+
30
+ ifeq ($(OS),Linux)
31
+ $(SUDO) $(SH) bash ci/install-linux.sh
32
+ else ifeq ($(OS),Darwin)
33
+ @$(SH) bash ci/install-mac.sh
34
+ else
35
+ @echo "Unsupported OS: $(OS)"
36
+ @exit 1
37
+ endif
38
+
39
+ publish:
40
+ @$(SH) pdm publish
41
+
42
+ build:
43
+ @$(SH) pdm build
44
+
45
+ install:
46
+ @$(SH) pdm install "-G:all"
47
+
48
+ sync:
49
+ @$(SH) pdm sync "-G:all"
50
+
51
+ pytest:
52
+ @$(SH) pdm run pytest $(PYTEST_FLAGS)
53
+
54
+ autoflake:
55
+ @$(SH) pdm run autoflake . $(CHECK_FLAG)
56
+
57
+ black:
58
+ @$(SH) pdm run black . $(CHECK_FLAG)
59
+
60
+ isort:
61
+ @$(SH) pdm run isort . $(CHECK_FLAG)
62
+
63
+ mypy:
64
+ @$(SH) pdm run mypy --install-types --non-interactive src
65
+
66
+
67
+ sphinx:
68
+ @$(SH) pdm run make -C docs html
69
+
70
+ docs: sphinx
71
+ @$(SH) bash ci/docs.sh
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioway
3
- Version: 0.2
3
+ Version: 0.3
4
4
  Summary: AI on the way
5
5
  Author-email: RenChu Wang <patrick1031wang@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -9,10 +9,9 @@ Description-Content-Type: text/markdown
9
9
  License-File: LICENSE.md
10
10
  Requires-Dist: numpy>=2
11
11
  Requires-Dist: pandas>=3
12
- Requires-Dist: torch==2.10.*
12
+ Requires-Dist: torch>=2
13
13
  Requires-Dist: tensordict>=0.11
14
14
  Requires-Dist: torchvision>=0.25
15
- Requires-Dist: torchcodec==0.10.*
16
15
  Requires-Dist: rich>=14
17
16
  Requires-Dist: pillow>=12
18
17
  Requires-Dist: av>=17
@@ -0,0 +1,18 @@
1
+ # Copyright (c) AIoWay Authors - All Rights Reserved
2
+
3
+ echo "Removing files we did not ask for..."
4
+
5
+ echo "Pruning android..."
6
+ rm -rf /usr/local/lib/android
7
+
8
+ echo "Pruning dotnet..."
9
+ rm -rf /usr/share/dotnet
10
+
11
+ echo "Pruning ghcup..."
12
+ rm -rf /usr/local/.ghcup
13
+
14
+ echo "Pruning docker..."
15
+ docker system prune -af --volumes
16
+
17
+ echo "Investigating how much storage is used in GitHub Actions..."
18
+ df -h
aioway-0.3/ci/docs.sh ADDED
@@ -0,0 +1,10 @@
1
+ # Copyright (c) AIoWay Authors - All Rights Reserved
2
+
3
+ mkdir -p "public"
4
+
5
+ if [ ! -f "public/.gitignore" ]; then
6
+ printf '%s\n' '*' > "public/.gitignore"
7
+ fi
8
+
9
+ rsync -a "docs/" "public/"
10
+ rsync -a "docs/build/html/" "public/api/"
@@ -0,0 +1,5 @@
1
+ # Copyright (c) AIoWay Authors - All Rights Reserved
2
+
3
+ echo $ $@
4
+ $@
5
+ echo
@@ -0,0 +1,50 @@
1
+ # Copyright (c) AIoWay Authors - All Rights Reserved
2
+
3
+ "Launch github actions jobs in groups."
4
+
5
+ import argparse
6
+ import contextlib as ctxl
7
+ import os
8
+ import shutil
9
+ import subprocess
10
+ import sys
11
+
12
+
13
+ @ctxl.contextmanager
14
+ def group_by_stage(stage: str):
15
+ print(f"::group::{stage}", flush=True)
16
+ try:
17
+ yield
18
+ finally:
19
+ print(f"::endgroup::", flush=True)
20
+
21
+
22
+ def launch_proc(command: list[str], stage: str) -> int:
23
+ # Set columns to current terminal size - indent.
24
+ env = {**os.environ, **term_size_env()}
25
+
26
+ with group_by_stage(stage=stage):
27
+ completed = subprocess.run(
28
+ command, env=env, stdout=sys.stdout, stderr=sys.stdout
29
+ )
30
+
31
+ return completed.returncode
32
+
33
+
34
+ def term_size_env() -> dict[str, str]:
35
+ try:
36
+ terminal_size = shutil.get_terminal_size()
37
+ except IOError:
38
+ return {}
39
+
40
+ env = {}
41
+ env["COLUMNS"] = str(terminal_size.columns)
42
+ env["LINES"] = str(terminal_size.lines)
43
+ return env
44
+
45
+
46
+ if __name__ == "__main__":
47
+ parser = argparse.ArgumentParser()
48
+ args, command = parser.parse_known_args()
49
+ ret_code = launch_proc(command, stage=" ".join(command))
50
+ raise SystemExit(ret_code)
@@ -0,0 +1,8 @@
1
+ # Copyright (c) AIoWay Authors - All Rights Reserved
2
+
3
+ apt-get update
4
+
5
+ command -v pipx || apt-get install pipx -y
6
+ command -v ffmpeg || apt-get install ffmpeg -y
7
+
8
+ command -v pdm || pipx install pdm
@@ -0,0 +1,9 @@
1
+ # Copyright (c) AIoWay Authors - All Rights Reserved
2
+
3
+ command -v brew || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
4
+
5
+ command -v pipx || brew install pipx -y
6
+ command -v ffmpeg || brew install ffmpeg -y
7
+ command -v timeout || brew install coreutils -y
8
+
9
+ command -v pdm || pipx install pdm
@@ -0,0 +1,42 @@
1
+ # ---
2
+ # jupyter:
3
+ # jupytext:
4
+ # formats: py:percent
5
+ # text_representation:
6
+ # extension: .py
7
+ # format_name: percent
8
+ # format_version: '1.3'
9
+ # jupytext_version: 1.19.5
10
+ # kernelspec:
11
+ # display_name: Python 3 (ipykernel)
12
+ # language: python
13
+ # name: python3
14
+ # ---
15
+
16
+ # %%
17
+ import rich
18
+
19
+ from aioway.instrs import Instr
20
+
21
+
22
+ # %%
23
+ def find_subclasses(cls: type, seen: set[type]) -> None:
24
+ if cls in seen:
25
+ return
26
+ seen.add(cls)
27
+ for sub in cls.__subclasses__():
28
+ find_subclasses(sub, seen)
29
+
30
+
31
+ # %%
32
+ seen: set[type[Instr]] = set()
33
+ find_subclasses(Instr, seen)
34
+
35
+ # %%
36
+ classes = sorted(
37
+ seen,
38
+ key=lambda t: [not t.implements_nn(), t.deductor_is_defined(), t.__name__],
39
+ )
40
+ for c in classes:
41
+ if c.implements_nn():
42
+ rich.print(c, c.deductor_is_defined())
@@ -21,8 +21,8 @@ from torch import nn, optim
21
21
  from torch.utils import data as dutils
22
22
  from torchrl.data import tensor_specs as tspecs
23
23
 
24
+ from aioway.compilers import ClfLogitHead, linear_regression
24
25
  from aioway.dsets import DatasetIdxDset, Dset, InputTarget, MnistDataset
25
- from aioway.emits import ClfLogitHead, linear_regression
26
26
  from aioway.trainers import StaticTrainer, TrainCfg
27
27
  from aioway.tspecs import as_tspec
28
28
 
@@ -66,7 +66,8 @@ def main(batch_size: int):
66
66
 
67
67
  module = ClfLogitHead(linear_regression)(
68
68
  as_tspec(dset.input_tspec), as_tspec(dset.target_tspec)
69
- )
69
+ ).module()
70
+
70
71
  optimizer = optim.AdamW(module.parameters())
71
72
  loss_func = nn.CrossEntropyLoss()
72
73