haliax 1.4.dev374__tar.gz → 1.4.dev378__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 (115) hide show
  1. haliax-1.4.dev378/.github/workflows/run_quick_levanter_tests.yaml +49 -0
  2. {haliax-1.4.dev374 → haliax-1.4.dev378}/PKG-INFO +1 -1
  3. haliax-1.4.dev378/src/haliax/__about__.py +1 -0
  4. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/dropout.py +2 -2
  5. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/embedding.py +2 -2
  6. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/linear.py +5 -5
  7. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/normalization.py +2 -2
  8. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/scan.py +4 -4
  9. haliax-1.4.dev374/.github/workflows/run_quick_levanter_tests.yaml +0 -38
  10. haliax-1.4.dev374/src/haliax/__about__.py +0 -1
  11. {haliax-1.4.dev374 → haliax-1.4.dev378}/.coveragerc +0 -0
  12. {haliax-1.4.dev374 → haliax-1.4.dev378}/.flake8 +0 -0
  13. {haliax-1.4.dev374 → haliax-1.4.dev378}/.github/workflows/publish_dev.yaml +0 -0
  14. {haliax-1.4.dev374 → haliax-1.4.dev378}/.github/workflows/run_pre_commit.yaml +0 -0
  15. {haliax-1.4.dev374 → haliax-1.4.dev378}/.github/workflows/run_tests.yaml +0 -0
  16. {haliax-1.4.dev374 → haliax-1.4.dev378}/.gitignore +0 -0
  17. {haliax-1.4.dev374 → haliax-1.4.dev378}/.playbooks/add-types.md +0 -0
  18. {haliax-1.4.dev374 → haliax-1.4.dev378}/.pre-commit-config.yaml +0 -0
  19. {haliax-1.4.dev374 → haliax-1.4.dev378}/.readthedocs.yaml +0 -0
  20. {haliax-1.4.dev374 → haliax-1.4.dev378}/AGENTS.md +0 -0
  21. {haliax-1.4.dev374 → haliax-1.4.dev378}/CONTRIBUTING.md +0 -0
  22. {haliax-1.4.dev374 → haliax-1.4.dev378}/LICENSE +0 -0
  23. {haliax-1.4.dev374 → haliax-1.4.dev378}/README.md +0 -0
  24. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/api.md +0 -0
  25. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/broadcasting.md +0 -0
  26. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/cheatsheet.md +0 -0
  27. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/css/material.css +0 -0
  28. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/css/mkdocstrings.css +0 -0
  29. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/faq.md +0 -0
  30. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/data_parallel_mesh.png +0 -0
  31. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/data_parallel_mesh_replicated.png +0 -0
  32. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_1d.png +0 -0
  33. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_1d_zero.png +0 -0
  34. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_2d.png +0 -0
  35. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_2d_batch_partitioned.png +0 -0
  36. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_2d_data_replicated.png +0 -0
  37. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_2d_data_replicated_mlp_partitioned.png +0 -0
  38. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_2d_intermediate_fully_partitioned.png +0 -0
  39. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/figures/device_mesh_2d_zero.png +0 -0
  40. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/fp8.md +0 -0
  41. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/index.md +0 -0
  42. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/indexing.md +0 -0
  43. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/matmul.md +0 -0
  44. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/nn.md +0 -0
  45. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/partitioning.md +0 -0
  46. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/rearrange.ipynb +0 -0
  47. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/rearrange.md +0 -0
  48. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/requirements.txt +0 -0
  49. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/scan.md +0 -0
  50. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/state-dict.md +0 -0
  51. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/tutorial.md +0 -0
  52. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/typing.md +0 -0
  53. {haliax-1.4.dev374 → haliax-1.4.dev378}/docs/vmap.md +0 -0
  54. {haliax-1.4.dev374 → haliax-1.4.dev378}/mkdocs.yml +0 -0
  55. {haliax-1.4.dev374 → haliax-1.4.dev378}/pyproject.toml +0 -0
  56. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/__init__.py +0 -0
  57. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/__init__.py +0 -0
  58. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/compile_utils.py +0 -0
  59. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/dot.py +0 -0
  60. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/einsum.py +0 -0
  61. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/fp8.py +0 -0
  62. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/parsing.py +0 -0
  63. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/rearrange.py +0 -0
  64. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/scan.py +0 -0
  65. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/state_dict.py +0 -0
  66. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/_src/util.py +0 -0
  67. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/axis.py +0 -0
  68. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/core.py +0 -0
  69. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/debug.py +0 -0
  70. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/haxtyping.py +0 -0
  71. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/hof.py +0 -0
  72. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/jax_utils.py +0 -0
  73. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/__init__.py +0 -0
  74. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/activations.py +0 -0
  75. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/attention.py +0 -0
  76. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/conv.py +0 -0
  77. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/loss.py +0 -0
  78. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/mlp.py +0 -0
  79. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/nn/pool.py +0 -0
  80. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/ops.py +0 -0
  81. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/partitioning.py +0 -0
  82. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/quantization.py +0 -0
  83. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/random.py +0 -0
  84. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/specialized_fns.py +0 -0
  85. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/state_dict.py +0 -0
  86. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/tree_util.py +0 -0
  87. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/types.py +0 -0
  88. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/util.py +0 -0
  89. {haliax-1.4.dev374 → haliax-1.4.dev378}/src/haliax/wrap.py +0 -0
  90. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/core_test.py +0 -0
  91. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_attention.py +0 -0
  92. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_axis.py +0 -0
  93. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_conv.py +0 -0
  94. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_debug.py +0 -0
  95. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_dot.py +0 -0
  96. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_dtype_typing.py +0 -0
  97. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_einsum.py +0 -0
  98. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_fp8.py +0 -0
  99. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_hof.py +0 -0
  100. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_int8.py +0 -0
  101. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_namedarray_typing.py +0 -0
  102. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_nn.py +0 -0
  103. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_ops.py +0 -0
  104. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_parsing.py +0 -0
  105. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_partitioning.py +0 -0
  106. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_pool.py +0 -0
  107. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_random.py +0 -0
  108. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_rearrange.py +0 -0
  109. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_scan.py +0 -0
  110. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_scatter_gather.py +0 -0
  111. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_specialized_fns.py +0 -0
  112. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_state_dict.py +0 -0
  113. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_tree_util.py +0 -0
  114. {haliax-1.4.dev374 → haliax-1.4.dev378}/tests/test_utils.py +0 -0
  115. {haliax-1.4.dev374 → haliax-1.4.dev378}/uv.lock +0 -0
@@ -0,0 +1,49 @@
1
+ name: Run Levanter & Haliax Tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ matrix:
12
+ python-version: ["3.10", "3.11"]
13
+ steps:
14
+ - name: Checkout repository
15
+ uses: actions/checkout@v3
16
+
17
+ - name: Cache pip and uv artifacts
18
+ uses: actions/cache@v3
19
+ with:
20
+ path: |
21
+ ~/.cache/pip
22
+ ~/.cache/uv
23
+ key: ${{ runner.os }}-pip-uv-${{ matrix.python-version }}-${{ hashFiles('**/requirements.lock', '**/uv.lock') }}
24
+ restore-keys: |
25
+ ${{ runner.os }}-pip-uv-${{ matrix.python-version }}-
26
+
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v4
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+
32
+ - name: Install uv and sync dependencies
33
+ run: |
34
+ pip install uv
35
+ uv venv .venv
36
+ uv sync
37
+
38
+ - name: Install Levanter and Haliax in editable mode
39
+ run: |
40
+ uv pip install -e .[tests]
41
+ uv pip install -e ../haliax
42
+ uv pip install pytest
43
+
44
+ - name: Run pytest suite
45
+ env:
46
+ XLA_FLAGS: --xla_force_host_platform_device_count=8
47
+ VIRTUAL_ENV: ${{ github.workspace }}/.venv
48
+ run: |
49
+ uv run pytest tests -m "not entry and not slow"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haliax
3
- Version: 1.4.dev374
3
+ Version: 1.4.dev378
4
4
  Summary: Named Tensors for Legible Deep Learning in JAX
5
5
  Project-URL: Homepage, https://github.com/stanford-crfm/haliax
6
6
  Project-URL: Bug Tracker, https://github.com/stanford-crfm/haliax/issues/
@@ -0,0 +1 @@
1
+ __version__ = "1.4.dev378"
@@ -61,8 +61,8 @@ class Dropout(eqx.Module):
61
61
  """
62
62
 
63
63
  # key difference from equinox: these are static fields
64
- pdrop: float = eqx.static_field()
65
- broadcast_axes: Optional[AxisSpec] = eqx.static_field()
64
+ pdrop: float = eqx.field(static=True)
65
+ broadcast_axes: Optional[AxisSpec] = eqx.field(static=True)
66
66
  inference: bool = False # note: not static
67
67
 
68
68
  def __init__(
@@ -17,8 +17,8 @@ class Embedding(eqx.Module):
17
17
  weight: NamedArray
18
18
 
19
19
  # axes
20
- Vocab: Axis = eqx.static_field()
21
- Embed: AxisSpec = eqx.static_field()
20
+ Vocab: Axis = eqx.field(static=True)
21
+ Embed: AxisSpec = eqx.field(static=True)
22
22
 
23
23
  @staticmethod
24
24
  def init(Vocab: Axis, Embed: AxisSpec, *, init_scale: float = 1, key, initializer_range: Optional[float] = None):
@@ -28,8 +28,8 @@ class Linear(ModuleWithStateDictSerialization):
28
28
  weight: NamedArray
29
29
  bias: Optional[NamedArray]
30
30
 
31
- In: AxisSpec = eqx.static_field()
32
- Out: AxisSpec = eqx.static_field()
31
+ In: AxisSpec = eqx.field(static=True)
32
+ Out: AxisSpec = eqx.field(static=True)
33
33
  dot_general: DotGeneralOp = eqx.field(default_factory=DotGeneralOp.default)
34
34
 
35
35
  @staticmethod
@@ -140,9 +140,9 @@ class MoELinear(eqx.Module):
140
140
  weight: NamedArray
141
141
  bias: Optional[NamedArray]
142
142
 
143
- Experts: AxisSpec = eqx.static_field()
144
- In: Axis = eqx.static_field()
145
- Out: Axis = eqx.static_field()
143
+ Experts: AxisSpec = eqx.field(static=True)
144
+ In: Axis = eqx.field(static=True)
145
+ Out: Axis = eqx.field(static=True)
146
146
  # TODO: support quanitization for ragged_dot?
147
147
  # dot_general: DotGeneralOp = eqx.field(default_factory=DotGeneralOp.default)
148
148
 
@@ -20,10 +20,10 @@ A = TypeVar("A", Scalar, NamedArray, jnp.ndarray)
20
20
 
21
21
 
22
22
  class LayerNormBase(ModuleWithStateDictSerialization):
23
- axis: AxisSpec = eqx.static_field()
23
+ axis: AxisSpec = eqx.field(static=True)
24
24
  weight: Optional[NamedArray]
25
25
  bias: Optional[NamedArray]
26
- eps: float = eqx.static_field(default=1e-5)
26
+ eps: float = eqx.field(default=1e-5, static=True)
27
27
  dtype: Optional[jnp.dtype] = eqx.field(default=None, static=True)
28
28
 
29
29
  @abstractmethod
@@ -90,8 +90,8 @@ class BlockSeq(ModuleWithStateDictSerialization, Generic[M]):
90
90
  """
91
91
 
92
92
  blocks: Sequence[M]
93
- Block: Axis = eqx.static_field()
94
- gradient_checkpointing: ScanCheckpointPolicy = eqx.static_field()
93
+ Block: Axis = eqx.field(static=True)
94
+ gradient_checkpointing: ScanCheckpointPolicy = eqx.field(static=True)
95
95
 
96
96
  @classmethod
97
97
  def init(
@@ -279,8 +279,8 @@ class Stacked(ModuleWithStateDictSerialization, Generic[M]):
279
279
  # TODO: we can probably make this module support pipeline parallelism, but that's a whole project in itself
280
280
 
281
281
  stacked: M
282
- Block: Axis = eqx.static_field()
283
- gradient_checkpointing: ScanCheckpointPolicy = eqx.static_field()
282
+ Block: Axis = eqx.field(static=True)
283
+ gradient_checkpointing: ScanCheckpointPolicy = eqx.field(static=True)
284
284
 
285
285
  @classmethod
286
286
  def init(
@@ -1,38 +0,0 @@
1
- name: Run Levanter Tests
2
-
3
- on: [pull_request]
4
-
5
- jobs:
6
- build:
7
-
8
- runs-on: ubuntu-latest
9
-
10
- steps:
11
- - uses: actions/checkout@v3
12
- - name: Set up Python 3.10.11
13
- uses: actions/setup-python@v4
14
- with:
15
- python-version: 3.10.11
16
- - name: Install dependencies
17
- run: |
18
- python -m pip install --upgrade pip
19
- pip install flake8 pytest
20
- pip install "jax[cpu]==0.5.3" "jaxlib[cpu]==0.5.3" .[dev]
21
-
22
- - name: Install Levanter from source
23
- run: |
24
- cd ..
25
- git clone https://github.com/stanford-crfm/levanter.git
26
- cd levanter
27
- pip install -e .[tests]
28
- pip install -r tests/requirements.txt
29
- # i don't know why this is necessary
30
- pip install tensorboardX
31
- - name: Install Haliax on top
32
- run: |
33
- # install second since levanter will install a built version of haliax
34
- cd ../haliax
35
- - name: Test levanter with pytest
36
- run: |
37
- cd ../levanter
38
- XLA_FLAGS=--xla_force_host_platform_device_count=8 PYTHONPATH=tests:src:../src pytest tests -m "not entry and not slow"
@@ -1 +0,0 @@
1
- __version__ = "1.4.dev374"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes