orbitquant 0.1.0__tar.gz → 0.1.2__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 (133) hide show
  1. {orbitquant-0.1.0 → orbitquant-0.1.2}/.github/workflows/publish-pypi.yml +1 -1
  2. {orbitquant-0.1.0 → orbitquant-0.1.2}/PKG-INFO +17 -3
  3. {orbitquant-0.1.0 → orbitquant-0.1.2}/README.md +16 -2
  4. {orbitquant-0.1.0 → orbitquant-0.1.2}/docs/kernel-audit.md +149 -6
  5. orbitquant-0.1.2/docs/kernel-hub-approval-request.md +290 -0
  6. {orbitquant-0.1.0 → orbitquant-0.1.2}/docs/publication-checklist.md +39 -28
  7. orbitquant-0.1.2/docs/release-0.1.1.md +31 -0
  8. orbitquant-0.1.2/docs/release-0.1.2.md +28 -0
  9. orbitquant-0.1.2/docs/release-gates.md +349 -0
  10. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/CARD.md +19 -4
  11. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/benchmarks/benchmark.py +56 -8
  12. {orbitquant-0.1.0 → orbitquant-0.1.2}/pyproject.toml +1 -1
  13. orbitquant-0.1.2/scripts/verify_hf_kernel_model_artifact.py +407 -0
  14. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/__init__.py +1 -1
  15. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/benchmarks.py +1 -1
  16. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/cli/main.py +53 -2
  17. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/config.py +1 -1
  18. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/kernels/native_packed_matmul.py +1 -1
  19. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/kernels/triton_cuda.py +1 -1
  20. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_benchmarks.py +1 -1
  21. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_ci.py +31 -0
  22. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_cli.py +85 -1
  23. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_config.py +1 -0
  24. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_distribution.py +1 -0
  25. orbitquant-0.1.2/tests/test_kernel_model_verifier.py +91 -0
  26. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_native_kernel_package.py +11 -0
  27. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_optional_dependencies.py +3 -1
  28. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_readme.py +4 -0
  29. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_release_gates.py +316 -56
  30. {orbitquant-0.1.0 → orbitquant-0.1.2}/uv.lock +1 -1
  31. orbitquant-0.1.0/docs/kernel-hub-approval-request.md +0 -156
  32. orbitquant-0.1.0/docs/release-gates.md +0 -229
  33. {orbitquant-0.1.0 → orbitquant-0.1.2}/.github/workflows/ci.yml +0 -0
  34. {orbitquant-0.1.0 → orbitquant-0.1.2}/.gitignore +0 -0
  35. {orbitquant-0.1.0 → orbitquant-0.1.2}/LICENSE +0 -0
  36. {orbitquant-0.1.0 → orbitquant-0.1.2}/docs/paper-methodology-audit.md +0 -0
  37. {orbitquant-0.1.0 → orbitquant-0.1.2}/docs/release-0.1.0.md +0 -0
  38. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/build.toml +0 -0
  39. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/example.py +0 -0
  40. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/flake.lock +0 -0
  41. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/flake.nix +0 -0
  42. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/orbitquant_packed_matmul_cuda/packed_matmul.cu +0 -0
  43. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/orbitquant_packed_matmul_metal/packed_matmul.metal +0 -0
  44. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/orbitquant_packed_matmul_metal/packed_matmul.mm +0 -0
  45. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/tests/__init__.py +0 -0
  46. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/tests/test_packed_matmul.py +0 -0
  47. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/torch-ext/orbitquant_packed_matmul/__init__.py +0 -0
  48. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/torch-ext/torch_binding.cpp +0 -0
  49. {orbitquant-0.1.0 → orbitquant-0.1.2}/native-kernels/orbitquant-packed-matmul/torch-ext/torch_binding.h +0 -0
  50. {orbitquant-0.1.0 → orbitquant-0.1.2}/scripts/run_cuda_kernel_checks.sh +0 -0
  51. {orbitquant-0.1.0 → orbitquant-0.1.2}/scripts/run_hf_compat_checks.sh +0 -0
  52. {orbitquant-0.1.0 → orbitquant-0.1.2}/scripts/run_mps_kernel_checks.sh +0 -0
  53. {orbitquant-0.1.0 → orbitquant-0.1.2}/scripts/run_paper_methodology_checks.sh +0 -0
  54. {orbitquant-0.1.0 → orbitquant-0.1.2}/scripts/runpod_ssh_health.sh +0 -0
  55. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/adaln.py +0 -0
  56. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/__init__.py +0 -0
  57. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/assets.py +0 -0
  58. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/benchmark.py +0 -0
  59. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/checksums.py +0 -0
  60. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/comparisons.py +0 -0
  61. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/loader.py +0 -0
  62. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/manifest.py +0 -0
  63. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/model_card.py +0 -0
  64. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/refresh.py +0 -0
  65. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/repair.py +0 -0
  66. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/validator.py +0 -0
  67. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/artifacts/writer.py +0 -0
  68. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/cli/__init__.py +0 -0
  69. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/codebooks/__init__.py +0 -0
  70. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/codebooks/lloyd_max.py +0 -0
  71. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/errors.py +0 -0
  72. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/__init__.py +0 -0
  73. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/assets.py +0 -0
  74. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/external_export.py +0 -0
  75. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/external_metrics.py +0 -0
  76. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/external_plan.py +0 -0
  77. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/metrics.py +0 -0
  78. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/native_plan.py +0 -0
  79. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/native_runner.py +0 -0
  80. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/native_settings.py +0 -0
  81. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/prompts.py +0 -0
  82. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/eval/report.py +0 -0
  83. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/functional.py +0 -0
  84. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/hub.py +0 -0
  85. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/kernels/__init__.py +0 -0
  86. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/kernels/dispatch.py +0 -0
  87. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/kernels/mps.py +0 -0
  88. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/layers.py +0 -0
  89. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/modeling.py +0 -0
  90. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/packing/__init__.py +0 -0
  91. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/packing/bitpack.py +0 -0
  92. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/pipeline.py +0 -0
  93. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/policies/__init__.py +0 -0
  94. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/policies/flux.py +0 -0
  95. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/policies/flux2.py +0 -0
  96. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/policies/generic_dit.py +0 -0
  97. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/policies/wan.py +0 -0
  98. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/policies/z_image.py +0 -0
  99. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/quantizer.py +0 -0
  100. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/rotations/__init__.py +0 -0
  101. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/rotations/fwht.py +0 -0
  102. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/rotations/rpbh.py +0 -0
  103. {orbitquant-0.1.0 → orbitquant-0.1.2}/src/orbitquant/transformers_ops.py +0 -0
  104. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_adaln_rtn.py +0 -0
  105. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_artifact_writer.py +0 -0
  106. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_bitpack.py +0 -0
  107. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_cli_report.py +0 -0
  108. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_codebooks.py +0 -0
  109. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_diffusers_modelmixin_integration.py +0 -0
  110. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_eval_assets.py +0 -0
  111. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_eval_prompts.py +0 -0
  112. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_eval_report.py +0 -0
  113. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_external_eval_plan.py +0 -0
  114. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_external_export.py +0 -0
  115. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_hub.py +0 -0
  116. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_kernels.py +0 -0
  117. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_manifest.py +0 -0
  118. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_model_card.py +0 -0
  119. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_model_quantization.py +0 -0
  120. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_native_packed_matmul.py +0 -0
  121. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_native_runner.py +0 -0
  122. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_native_settings.py +0 -0
  123. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_orbit_linear.py +0 -0
  124. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_paper_alignment.py +0 -0
  125. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_paper_methodology.py +0 -0
  126. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_pipeline_helpers.py +0 -0
  127. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_policies.py +0 -0
  128. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_prompt_jobs.py +0 -0
  129. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_prompt_selection.py +0 -0
  130. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_quantizer_adapter.py +0 -0
  131. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_rpbh.py +0 -0
  132. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_target_policies.py +0 -0
  133. {orbitquant-0.1.0 → orbitquant-0.1.2}/tests/test_transformers_pretrained_integration.py +0 -0
@@ -6,7 +6,7 @@ on:
6
6
  version:
7
7
  description: Version to publish
8
8
  required: true
9
- default: "0.1.0"
9
+ default: "0.1.2"
10
10
 
11
11
  jobs:
12
12
  build:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orbitquant
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Clean-room OrbitQuant implementation for diffusion transformers
5
5
  Project-URL: Homepage, https://github.com/iamwavecut/OrbitQuant
6
6
  Project-URL: Repository, https://github.com/iamwavecut/OrbitQuant
@@ -81,8 +81,7 @@ Install the package with the Hugging Face runtime dependencies:
81
81
  pip install "orbitquant[hf]"
82
82
  ```
83
83
 
84
- Until the first PyPI release is available, install the same package directly
85
- from GitHub:
84
+ The development branch can also be installed directly from GitHub:
86
85
 
87
86
  ```bash
88
87
  pip install "orbitquant[hf] @ git+https://github.com/iamwavecut/OrbitQuant.git"
@@ -377,6 +376,7 @@ Published Hub repositories can be checked without downloading tensor weights:
377
376
  orbitquant audit-hf-artifacts \
378
377
  --namespace WaveCut \
379
378
  --policy-inventory-root ./reports/native/module-inventories \
379
+ --summary-only \
380
380
  --fail-on-artifact-regression \
381
381
  --output ./reports/native/hf-artifact-audit.json \
382
382
  --markdown-output ./reports/native/hf-artifact-audit.md
@@ -512,6 +512,20 @@ Apple Silicon. Full-model speedup claims still require backend-specific
512
512
  benchmark artifacts for the target model and native settings. See
513
513
  [docs/kernel-audit.md](docs/kernel-audit.md) for the release claim boundary.
514
514
 
515
+ To verify that a published OrbitQuant model artifact executes through the
516
+ native packed matmul runtime without running full image/video generation:
517
+
518
+ ```bash
519
+ LOCAL_KERNELS="WaveCut/orbitquant-packed-matmul=/path/to/build/torch212-metal-aarch64-darwin" \
520
+ uv run python scripts/verify_hf_kernel_model_artifact.py --device mps
521
+ ```
522
+
523
+ The default artifact is `WaveCut/FLUX.2-klein-4B-OrbitQuant-W4A4`. The script
524
+ loads one quantized transformer projection from the artifact, runs it with
525
+ `runtime_mode="native_packed_matmul"`, compares it with `dequant_bf16`, and
526
+ prints JSON with finite-output, allclose, error, and packed-vs-materialized
527
+ weight storage fields.
528
+
515
529
  ## License
516
530
 
517
531
  Code in this repository is Apache-2.0. Quantized artifacts also record the
@@ -37,8 +37,7 @@ Install the package with the Hugging Face runtime dependencies:
37
37
  pip install "orbitquant[hf]"
38
38
  ```
39
39
 
40
- Until the first PyPI release is available, install the same package directly
41
- from GitHub:
40
+ The development branch can also be installed directly from GitHub:
42
41
 
43
42
  ```bash
44
43
  pip install "orbitquant[hf] @ git+https://github.com/iamwavecut/OrbitQuant.git"
@@ -333,6 +332,7 @@ Published Hub repositories can be checked without downloading tensor weights:
333
332
  orbitquant audit-hf-artifacts \
334
333
  --namespace WaveCut \
335
334
  --policy-inventory-root ./reports/native/module-inventories \
335
+ --summary-only \
336
336
  --fail-on-artifact-regression \
337
337
  --output ./reports/native/hf-artifact-audit.json \
338
338
  --markdown-output ./reports/native/hf-artifact-audit.md
@@ -468,6 +468,20 @@ Apple Silicon. Full-model speedup claims still require backend-specific
468
468
  benchmark artifacts for the target model and native settings. See
469
469
  [docs/kernel-audit.md](docs/kernel-audit.md) for the release claim boundary.
470
470
 
471
+ To verify that a published OrbitQuant model artifact executes through the
472
+ native packed matmul runtime without running full image/video generation:
473
+
474
+ ```bash
475
+ LOCAL_KERNELS="WaveCut/orbitquant-packed-matmul=/path/to/build/torch212-metal-aarch64-darwin" \
476
+ uv run python scripts/verify_hf_kernel_model_artifact.py --device mps
477
+ ```
478
+
479
+ The default artifact is `WaveCut/FLUX.2-klein-4B-OrbitQuant-W4A4`. The script
480
+ loads one quantized transformer projection from the artifact, runs it with
481
+ `runtime_mode="native_packed_matmul"`, compares it with `dequant_bf16`, and
482
+ prints JSON with finite-output, allclose, error, and packed-vs-materialized
483
+ weight storage fields.
484
+
471
485
  ## License
472
486
 
473
487
  Code in this repository is Apache-2.0. Quantized artifacts also record the
@@ -45,6 +45,13 @@ for the current artifact format and runtime modes.
45
45
  packed matmul package. Set `ORBITQUANT_RUN_NATIVE_KERNEL_PACKAGE_CI=0` only
46
46
  to verify the inline Metal shader stages without closing the native packed
47
47
  matmul package gate.
48
+ - `scripts/verify_hf_kernel_model_artifact.py` is a model-artifact verification
49
+ script for reviewers. It downloads one published OrbitQuant artifact by
50
+ default, restores one real packed `OrbitQuantLinear` transformer projection,
51
+ runs it through `runtime_mode="native_packed_matmul"`, compares against
52
+ `dequant_bf16`, and prints finite-output, allclose, error, and weight-side
53
+ storage accounting JSON. It intentionally avoids full Diffusers pipeline
54
+ loading and image/video generation.
48
55
  - Full-model speedup claims require backend-specific benchmark artifacts from
49
56
  the target model class and native settings. Synthetic kernel benchmarks are
50
57
  useful diagnostics, not release evidence for FLUX, Z-Image, or Wan throughput.
@@ -64,11 +71,17 @@ for the current artifact format and runtime modes.
64
71
  `upstream`/`source` metadata. The run verified kernel-builder layout hooks,
65
72
  macOS 15/Python ABI 3.9 compatibility, get-kernel loading, and 17 package
66
73
  tests for the Metal build.
67
- - A private Hugging Face source snapshot exists at
74
+ - A public Hugging Face source snapshot exists at
68
75
  `WaveCut/orbitquant-packed-matmul` commit
69
- `6821e4cd5ff1894994d7137c1d861660cfeed1c8`, refreshed on
70
- 2026-07-08T18:00Z after adding CUDA launch-error checks, but Kernel Hub
71
- publication is not yet approved for the account. On 2026-07-08T17:02Z,
76
+ `cb0ceb1a4d070556c52cfba691aba3f6647c246b`. It contains the tracked
77
+ `native-kernels/orbitquant-packed-matmul` source package with no generated
78
+ `build/`, local `.venv/`, `__pycache__/`, binary extension, or benchmark
79
+ output files. The PyPI `orbitquant-0.1.0.tar.gz` source distribution also
80
+ contains this kernel source under
81
+ `orbitquant-0.1.0/native-kernels/orbitquant-packed-matmul/`, with SHA256
82
+ `6abedb769b32c8d70f2763278e106346319d628d85ed7469549faa5020ab1a89`.
83
+ Kernel Hub publication is not yet approved for the account. On
84
+ 2026-07-08T17:02Z,
72
85
  `nix --option sandbox relaxed run .#build-and-copy -L` built and copied the
73
86
  three Metal variants, and
74
87
  `nix --option sandbox relaxed run .#build-and-upload -L` found those variants
@@ -79,6 +92,61 @@ for the current artifact format and runtime modes.
79
92
  source snapshot `6821e4cd5ff1894994d7137c1d861660cfeed1c8` and source
80
93
  archive SHA256
81
94
  `77aef6caa1bbdbbd77e2cbf5003423073e001191d008473c957795d7bed03651`.
95
+ A second follow-up comment on 2026-07-09T11:56Z points reviewers to the
96
+ public source snapshot, checked commit
97
+ `b050a89d6e6f52098c73d904a85011231f77485c`, public PyPI source
98
+ distribution URL, and SHA256.
99
+ A third follow-up comment on 2026-07-09T12:22Z points reviewers to source
100
+ snapshot `c34d9851cde2cf098589927a7b0bed85d65426af`, whose benchmark reports
101
+ both `predequantized_f_linear_seconds_per_iter` and
102
+ `dequantize_then_f_linear_seconds_per_iter`. That comment explicitly
103
+ clarifies that the current MPS native packed matmul path is not throughput
104
+ proof for large matrices: local W4 512x1024x1024 fp16 measured about
105
+ `0.045x` versus dequantize-then-F.linear, and W4 512x3072x3072 fp16 measured
106
+ about `0.044x` versus dequantize-then-F.linear. Treat those MPS numbers as
107
+ correctness and memory-path evidence only, not performance evidence.
108
+ A fourth follow-up comment on 2026-07-09T12:27Z answered the model-scope
109
+ question: the kernel is intended for OrbitQuant-converted diffusion
110
+ transformer backbones with packed `OrbitQuantLinear` layers, currently FLUX.1
111
+ Schnell, FLUX.2 Klein, Z-Image-Turbo, and Wan2.1-T2V-1.3B-Diffusers; it is
112
+ not a drop-in kernel for arbitrary unquantized models or skipped components
113
+ such as text encoders, VAEs, embeddings, timestep MLPs, or final projection
114
+ heads.
115
+ The public source snapshot was updated again on 2026-07-09T12:39Z to commit
116
+ `cb0ceb1a4d070556c52cfba691aba3f6647c246b`; the benchmark now also reports
117
+ `packed_weight_path_bytes`, `materialized_weight_bytes`, and
118
+ `packed_weight_path_vs_materialized_weight_ratio` so kernel review can
119
+ distinguish weight-side storage savings from throughput claims.
120
+ A fifth follow-up comment on 2026-07-09T12:41Z points reviewers to this
121
+ snapshot and repeats that the storage fields are memory-path accounting, not
122
+ large-matrix throughput proof.
123
+ After reviewer asked for model-level verification scripts,
124
+ `scripts/verify_hf_kernel_model_artifact.py` was added to verify the default
125
+ `WaveCut/FLUX.2-klein-4B-OrbitQuant-W4A4` artifact at one restored packed
126
+ transformer projection without running full generation.
127
+ A sixth follow-up comment on 2026-07-09T12:50Z points reviewers to commit
128
+ `f42d2dc19897adde62ec3ebb33e4ce748255dd54` and includes MPS/CUDA
129
+ `LOCAL_KERNELS` commands for running that verifier.
130
+ On 2026-07-09T12:57Z, that verifier passed locally on Apple Silicon MPS using
131
+ the `torch212-metal-aarch64-darwin` local kernel variant and the published
132
+ `WaveCut/FLUX.2-klein-4B-OrbitQuant-W4A4` artifact. It restored
133
+ `transformer_blocks.0.attn.to_q` with shape 3072x3072, ran
134
+ `runtime_mode="native_packed_matmul"` for one token, compared against
135
+ `dequant_bf16`, and reported `finite=true`, `allclose_to_dequant_bf16=true`,
136
+ `max_abs_error_vs_dequant_bf16=0.001953125`, and
137
+ `packed_weight_path_vs_materialized_weight_ratio=0.2503289116753472`.
138
+ A seventh follow-up comment on 2026-07-09T12:58Z posted the verifier command
139
+ and JSON result summary to discussion 15.
140
+ On 2026-07-09T13:05Z, the same published artifact layer was re-verified with
141
+ `runtime_mode="auto_fused"` and the same local
142
+ `torch212-metal-aarch64-darwin` package. It again reported `finite=true`,
143
+ `allclose_to_dequant_bf16=true`,
144
+ `max_abs_error_vs_dequant_bf16=0.001953125`, and
145
+ `packed_weight_path_vs_materialized_weight_ratio=0.2503289116753472`.
146
+ This proves that default optimized dispatch reaches the native packed matmul
147
+ path for a real published artifact when the local Metal package is available.
148
+ An eighth follow-up comment on 2026-07-09T13:05Z posted the `auto_fused`
149
+ command and JSON result summary to discussion 15.
82
150
  Re-running `nix --option sandbox relaxed run .#build-and-upload -L` on
83
151
  2026-07-08T18:12Z at OrbitQuant commit `956842a` rebuilt the three Metal
84
152
  variants, passed ABI/get-kernel build checks, and still stopped at the same
@@ -104,6 +172,80 @@ for the current artifact format and runtime modes.
104
172
  `quantize-bench` with exit 0. This verifies the Python/Triton CUDA path and
105
173
  packed-weight CUDA runtime fallback behavior, not the separate native CUDA
106
174
  kernel-builder package.
175
+ - A public-package CUDA smoke passed on 2026-07-09T13:15Z on the active RunPod
176
+ `orbitquant-cuda-gate-4090` pod (`ofz7pyxcw6vlzm`) with Torch 2.9.1+cu128,
177
+ CUDA 12.8, driver 580.159.04, and an NVIDIA GeForce RTX 4090. It installed
178
+ `orbitquant[kernels]==0.1.0` from PyPI into a temporary `/tmp` venv using
179
+ `--system-site-packages`, ran `orbitquant kernel-info`, and ran
180
+ `orbitquant kernel-bench --device cuda --dtype float16 --runtime-mode
181
+ auto_fused --tokens 16 --in-features 128 --out-features 128 --warmup 1
182
+ --iterations 2`. The benchmark selected `triton_cuda` for both activation
183
+ kernels and weight quantization, kept packed weight indices and row norms on
184
+ `cuda:0`, reported `forward_prewarmed_ms=0.14182400703430176`, and removed
185
+ the temporary venv after completion. This verifies the published PyPI package
186
+ CUDA/Triton `auto_fused` path, not the separate native CUDA Kernel Hub
187
+ package.
188
+ - After a reviewer asked for actual numbers, a model-like CUDA microbenchmark
189
+ was run on the same pod on 2026-07-09T13:21Z with
190
+ `orbitquant[kernels]==0.1.0` from PyPI, `tokens=512`, `in_features=3072`,
191
+ `out_features=3072`, W4A4, float16, warmup 2, and 5 iterations. The
192
+ `auto_fused` Triton path reported `forward_prewarmed_ms=0.6518784046173096`,
193
+ `forward_cold_ms=0.6581952095031738`, and `peak_memory_bytes=69293568`.
194
+ The explicit `dequant_bf16` reference reported
195
+ `forward_prewarmed_ms=0.13742079734802246`,
196
+ `forward_cold_ms=0.20090880393981933`, and
197
+ `peak_memory_bytes=115025408`. These numbers were posted to discussion 15 on
198
+ 2026-07-09T13:22Z with the explicit caveat that current CUDA/Triton
199
+ `auto_fused` is memory-path evidence, not a throughput win on this RTX 4090
200
+ microbenchmark.
201
+ - A follow-up tile sweep on the same RTX 4090, PyPI package, and
202
+ 512x3072x3072 W4A4 float16 benchmark found the best tested Triton packed
203
+ matmul tile at `block_m=32`, `block_n=128`, `block_k=64`, `num_warps=8`.
204
+ A focused 20-iteration confirmation measured the previous default
205
+ `block_n=64` at `forward_prewarmed_ms=0.6374400138854981` and the selected
206
+ `block_n=128` default at `forward_prewarmed_ms=0.596992015838623`, both with
207
+ `peak_memory_bytes=69293568`. This updates the package default tile for the
208
+ packed matmul path, but it remains a local CUDA/Triton microbenchmark result
209
+ and does not change the no-throughput-win claim boundary above.
210
+ - A post-publication CUDA smoke for `orbitquant[kernels]==0.1.1` passed on
211
+ 2026-07-09T14:07Z on the same active RunPod RTX 4090 with Torch 2.9.1+cu128,
212
+ CUDA 12.8, driver 580.159.04, 512x3072x3072 W4A4 float16, warmup 5, and 20
213
+ measured iterations. It verified `OrbitQuantConfig().runtime_mode ==
214
+ "auto_fused"` and `packed_matmul_block_n == 128` from the published package.
215
+ The `auto_fused` run selected `triton_cuda`, used tile `{block_m=32,
216
+ block_n=128, block_k=64, num_warps=8}`, kept packed weight indices and row
217
+ norms on `cuda:0`, and reported
218
+ `forward_prewarmed_ms=0.5946400165557861`,
219
+ `forward_cold_ms=0.6080512046813965`, and
220
+ `peak_memory_bytes=69293568`. The explicit `dequant_bf16` reference reported
221
+ `forward_prewarmed_ms=0.12743680477142333`,
222
+ `forward_cold_ms=0.1994752049446106`, and
223
+ `peak_memory_bytes=115025408`. This confirms the published 0.1.1 CUDA/Triton
224
+ memory path and tile default; it also confirms that this RTX 4090 isolated
225
+ benchmark still favors `dequant_bf16` for throughput by about 4.666x.
226
+ - After reviewer asked to run on an actual model, CUDA artifact-layer
227
+ verification passed on the same active RunPod RTX 4090 on 2026-07-09T13:54Z.
228
+ The verifier installed OrbitQuant from GitHub `main`, downloaded the
229
+ published `WaveCut/FLUX.2-klein-4B-OrbitQuant-W4A4` artifact, restored
230
+ `transformer_blocks.0.attn.to_q` (3072x3072) from source model
231
+ `black-forest-labs/FLUX.2-klein-4B` revision
232
+ `e7b7dc27f91deacad38e78976d1f2b499d76a294`, and ran 512 float16 tokens
233
+ through `runtime_mode="auto_fused"` with
234
+ `activation_kernel_backend="triton_cuda"`. The run used Torch 2.9.1+cu128,
235
+ CUDA 12.8, driver 580.159.04, W4A4, warmup 5, and 20 measured iterations. It
236
+ reported `finite=true`, `allclose_to_dequant_bf16=true`,
237
+ `max_abs_error_vs_dequant_bf16=0.015625`,
238
+ `packed_weight_path_bytes=4724800`, `materialized_weight_bytes=18874368`,
239
+ `packed_weight_path_vs_materialized_weight_ratio=0.2503289116753472`,
240
+ `peak_memory_bytes=87756800`,
241
+ `auto_fused_forward_first_ms=477.2464599609375`,
242
+ `auto_fused_forward_prewarmed_ms=0.6343167781829834`,
243
+ `dequant_bf16_forward_first_ms=103.32876586914062`, and
244
+ `dequant_bf16_forward_prewarmed_ms=0.1256432056427002`. This is actual
245
+ published artifact layer execution, not full FLUX image generation; it
246
+ supports the CUDA/Triton memory-path claim but not a throughput-win claim.
247
+ A follow-up comment with these actual model artifact numbers was posted to
248
+ discussion 15 on 2026-07-09T14:00Z.
107
249
  - Native CUDA `native_packed_matmul` still needs a compatible loadable variant.
108
250
  A locally built `build/torch29-cxx11-cu130-x86_64-linux` variant was copied
109
251
  to the same CUDA 12.8 host and failed before execution with
@@ -138,8 +280,9 @@ for the current artifact format and runtime modes.
138
280
  and benchmark stages were explicitly skipped.
139
281
  - On 2026-07-09, a prebuilt-only native loader check still found no loadable
140
282
  CUDA/Metal Kernel Hub artifact: `repo_info(..., repo_type="kernel")`
141
- returned 404 while the source snapshot model repo resolved to commit
142
- `6821e4cd5ff1894994d7137c1d861660cfeed1c8`. The native loader therefore
283
+ returned 404. After the storage-footprint benchmark update, the public source
284
+ snapshot model repo resolved to commit
285
+ `cb0ceb1a4d070556c52cfba691aba3f6647c246b`. The native loader therefore
143
286
  still requires `LOCAL_KERNELS`, an importable package, or Kernel Hub approval.
144
287
 
145
288
  ## Packaging Boundary
@@ -0,0 +1,290 @@
1
+ # Kernel Hub Approval Request
2
+
3
+ Use this as the source text for the Hugging Face `kernels-community/README`
4
+ discussion requested by `kernel-builder build-and-upload`:
5
+
6
+ `https://huggingface.co/spaces/kernels-community/README/discussions/new`
7
+
8
+ Submitted discussion:
9
+
10
+ `https://huggingface.co/spaces/kernels-community/README/discussions/15`
11
+
12
+ Follow-up comment:
13
+
14
+ On 2026-07-08T18:03Z, the discussion was updated with source snapshot
15
+ `6821e4cd5ff1894994d7137c1d861660cfeed1c8` and source archive SHA256
16
+ `77aef6caa1bbdbbd77e2cbf5003423073e001191d008473c957795d7bed03651`.
17
+
18
+ Reviewer follow-up:
19
+
20
+ On 2026-07-09T07:29Z, `sayakpaul` reported that the source snapshot repo URL
21
+ was not visible and asked for performance numbers. On 2026-07-09T09:59Z,
22
+ `WaveCut` replied without changing repository visibility: the source snapshot
23
+ repo is still private, the tracked source archive SHA256 is
24
+ `77aef6caa1bbdbbd77e2cbf5003423073e001191d008473c957795d7bed03651`, and the
25
+ reply offered either a public source-only snapshot repo or a source archive
26
+ through the preferred review channel. The reply also restated the MPS native
27
+ packed matmul smoke benchmark numbers and the CUDA/Triton partial gate evidence,
28
+ while keeping native CUDA package numbers pending.
29
+
30
+ Source visibility follow-up:
31
+
32
+ As of 2026-07-09T11:54Z, `WaveCut/orbitquant-packed-matmul` is public as a
33
+ source snapshot repo:
34
+
35
+ `https://huggingface.co/WaveCut/orbitquant-packed-matmul`
36
+
37
+ The live checked commit is
38
+ `cb0ceb1a4d070556c52cfba691aba3f6647c246b`. Its file list contains only the
39
+ tracked source/test files and no generated `build/`, local `.venv/`,
40
+ `__pycache__/`, binary `.so`, or benchmark output files.
41
+
42
+ The public PyPI source distribution also contains the reviewable kernel source:
43
+
44
+ - PyPI project: `https://pypi.org/project/orbitquant/0.1.0/`
45
+ - Source distribution:
46
+ `https://files.pythonhosted.org/packages/c8/41/1df33fe61ff5638a0b9385bbe0493353b62cfd8f39dd1ee7481487f92ed0/orbitquant-0.1.0.tar.gz`
47
+ - SHA256:
48
+ `6abedb769b32c8d70f2763278e106346319d628d85ed7469549faa5020ab1a89`
49
+ - Kernel path inside the archive:
50
+ `orbitquant-0.1.0/native-kernels/orbitquant-packed-matmul/`
51
+
52
+ The older source archive was locally prepared and checked on 2026-07-08T18:00Z:
53
+ `/tmp/orbitquant-packed-matmul-source.tar`, SHA256
54
+ `77aef6caa1bbdbbd77e2cbf5003423073e001191d008473c957795d7bed03651`,
55
+ 21 tar entries, and no generated `build/`, local `.venv/`, `__pycache__/`,
56
+ binary `.so`, or benchmark output files.
57
+
58
+ On 2026-07-09T11:56Z, `WaveCut` posted a follow-up comment in discussion 15
59
+ with the public source snapshot URL, checked commit, PyPI source distribution
60
+ URL, SHA256, and the same claim boundary: MPS native packed-matmul smoke
61
+ numbers plus CUDA/Triton gate evidence are available, while native CUDA
62
+ `native_packed_matmul` package numbers remain pending a compatible Kernel
63
+ Hub/CUDA build path.
64
+
65
+ On 2026-07-09T12:22Z, `WaveCut` posted another follow-up comment after
66
+ updating the benchmark source to snapshot
67
+ `c34d9851cde2cf098589927a7b0bed85d65426af`. The updated benchmark reports both
68
+ `predequantized_f_linear_seconds_per_iter` and
69
+ `dequantize_then_f_linear_seconds_per_iter`. The comment explicitly says the
70
+ current MPS native packed-matmul path is not throughput proof for large
71
+ matrices: local W4 512x1024x1024 fp16 measured about `0.045x` versus
72
+ dequantize-then-F.linear, and W4 512x3072x3072 fp16 measured about `0.044x`
73
+ versus dequantize-then-F.linear. The current CUDA source uses WMMA for
74
+ FP16/BF16 low-bit modes, but native CUDA package benchmarks remain pending a
75
+ compatible Kernel Hub/CUDA build path.
76
+
77
+ On 2026-07-09T12:27Z, `WaveCut` answered the model-scope question. The kernel
78
+ is model-agnostic at the operator level, but intended for OrbitQuant-converted
79
+ diffusion transformer backbones with packed `OrbitQuantLinear` layers. Current
80
+ target families are FLUX.1-schnell, FLUX.2 Klein, Z-Image-Turbo, and
81
+ Wan2.1-T2V-1.3B-Diffusers. The kernel is not intended for arbitrary
82
+ unquantized models, text encoders, VAEs, embeddings, timestep MLPs, or final
83
+ projection heads.
84
+
85
+ On 2026-07-09T12:39Z, the public source snapshot was updated to commit
86
+ `cb0ceb1a4d070556c52cfba691aba3f6647c246b`. The benchmark JSON now reports
87
+ packed weight storage fields:
88
+ `packed_weight_indices_bytes`, `row_norms_bytes`, `centroid_bytes`,
89
+ `packed_weight_path_bytes`, `materialized_weight_bytes`, and
90
+ `packed_weight_path_vs_materialized_weight_ratio`.
91
+
92
+ On 2026-07-09T12:41Z, `WaveCut` posted a follow-up comment in discussion 15
93
+ with the `cb0ceb1a4d070556c52cfba691aba3f6647c246b` source snapshot URL and
94
+ the same claim boundary: the new fields are weight-side storage accounting,
95
+ not throughput proof; native CUDA package benchmark evidence remains pending a
96
+ compatible Kernel Hub/CUDA build path.
97
+
98
+ On 2026-07-09T12:42Z, `sayakpaul` asked for a way to try optimizing one target
99
+ model with these kernels. The repository now includes
100
+ `scripts/verify_hf_kernel_model_artifact.py`, which verifies one published
101
+ OrbitQuant artifact layer through `runtime_mode="native_packed_matmul"` and
102
+ compares it with `dequant_bf16` without loading the full Diffusers pipeline or
103
+ running image/video generation.
104
+
105
+ On 2026-07-09T12:50Z, `WaveCut` replied with the verification script commit
106
+ `f42d2dc19897adde62ec3ebb33e4ce748255dd54`, MPS and CUDA `LOCAL_KERNELS`
107
+ example commands, and the expected behavior when no loadable native kernel is
108
+ available.
109
+
110
+ On 2026-07-09T12:57Z, the verifier passed locally on Apple Silicon MPS with
111
+ the `torch212-metal-aarch64-darwin` local kernel variant and the published
112
+ `WaveCut/FLUX.2-klein-4B-OrbitQuant-W4A4` artifact. It verified
113
+ `transformer_blocks.0.attn.to_q` (3072x3072) with
114
+ `runtime_mode="native_packed_matmul"` against `dequant_bf16` and reported
115
+ `finite=true`, `allclose_to_dequant_bf16=true`,
116
+ `max_abs_error_vs_dequant_bf16=0.001953125`, and
117
+ `packed_weight_path_vs_materialized_weight_ratio=0.2503289116753472`.
118
+
119
+ On 2026-07-09T12:58Z, `WaveCut` posted that verifier command and JSON result
120
+ summary in discussion 15.
121
+
122
+ On 2026-07-09T13:05Z, the same published artifact layer was re-verified with
123
+ `runtime_mode="auto_fused"` and the same local `torch212-metal-aarch64-darwin`
124
+ package. It again reported `finite=true`, `allclose_to_dequant_bf16=true`,
125
+ `max_abs_error_vs_dequant_bf16=0.001953125`, and
126
+ `packed_weight_path_vs_materialized_weight_ratio=0.2503289116753472`. This
127
+ checks the default optimized dispatch path, not only the explicit
128
+ `native_packed_matmul` mode.
129
+
130
+ On 2026-07-09T13:05Z, `WaveCut` posted that `auto_fused` verifier command and
131
+ JSON result summary in discussion 15.
132
+
133
+ On 2026-07-09T13:08Z, `sayakpaul` asked for actual reported numbers rather
134
+ than another script reference. A model-like CUDA microbenchmark was then run on
135
+ the active RTX 4090 RunPod with `orbitquant[kernels]==0.1.0` from PyPI, Torch
136
+ 2.9.1+cu128, CUDA 12.8, driver 580.159.04, `tokens=512`,
137
+ `in_features=3072`, `out_features=3072`, W4A4, float16, warmup 2, and
138
+ 5 iterations. The `auto_fused` Triton path reported
139
+ `forward_prewarmed_ms=0.6518784046173096`,
140
+ `forward_cold_ms=0.6581952095031738`, and `peak_memory_bytes=69293568`. The
141
+ explicit `dequant_bf16` reference reported
142
+ `forward_prewarmed_ms=0.13742079734802246`,
143
+ `forward_cold_ms=0.20090880393981933`, and
144
+ `peak_memory_bytes=115025408`.
145
+
146
+ On 2026-07-09T13:22Z, `WaveCut` posted those numbers in discussion 15 and
147
+ explicitly stated that the current CUDA/Triton `auto_fused` result is
148
+ memory-path evidence, not a throughput win on this RTX 4090 microbenchmark.
149
+
150
+ On 2026-07-09T13:54Z, after `sayakpaul` asked to run on an actual model, a
151
+ CUDA verifier passed on the active RTX 4090 RunPod using the published
152
+ `WaveCut/FLUX.2-klein-4B-OrbitQuant-W4A4` artifact. It restored
153
+ `transformer_blocks.0.attn.to_q` (3072x3072) from source model
154
+ `black-forest-labs/FLUX.2-klein-4B` revision
155
+ `e7b7dc27f91deacad38e78976d1f2b499d76a294`, ran 512 float16 tokens through
156
+ `runtime_mode="auto_fused"` with `activation_kernel_backend="triton_cuda"`,
157
+ and compared against `dequant_bf16`. The environment was Torch 2.9.1+cu128,
158
+ CUDA 12.8, driver 580.159.04, W4A4, warmup 5, and 20 measured iterations. The
159
+ result was `finite=true`, `allclose_to_dequant_bf16=true`,
160
+ `max_abs_error_vs_dequant_bf16=0.015625`,
161
+ `packed_weight_path_bytes=4724800`, `materialized_weight_bytes=18874368`,
162
+ `packed_weight_path_vs_materialized_weight_ratio=0.2503289116753472`,
163
+ `peak_memory_bytes=87756800`,
164
+ `auto_fused_forward_prewarmed_ms=0.6343167781829834`, and
165
+ `dequant_bf16_forward_prewarmed_ms=0.1256432056427002`. This is actual
166
+ published model artifact layer execution for CUDA/Triton; it is not full
167
+ image generation and it does not change the native CUDA Kernel Hub package
168
+ approval blocker.
169
+
170
+ On 2026-07-09T14:00Z, `WaveCut` posted those actual model artifact numbers in
171
+ discussion 15.
172
+
173
+ ## Title
174
+
175
+ Request Kernel Hub publish access for `WaveCut/orbitquant-packed-matmul`
176
+
177
+ ## Body
178
+
179
+ We would like Kernel Hub publish access to publish
180
+ `WaveCut/orbitquant-packed-matmul` as a Hugging Face Kernel Hub package.
181
+
182
+ Repository:
183
+
184
+ - Kernel Hub repo id: `WaveCut/orbitquant-packed-matmul`
185
+ - Source package path: `native-kernels/orbitquant-packed-matmul`
186
+ - Source repository: `https://github.com/iamwavecut/OrbitQuant`
187
+ - Review source snapshot: `https://huggingface.co/WaveCut/orbitquant-packed-matmul/commit/cb0ceb1a4d070556c52cfba691aba3f6647c246b`
188
+ - License: Apache-2.0
189
+
190
+ Review-ready source package:
191
+
192
+ The public source snapshot repo contains the reviewable tracked source snapshot
193
+ at:
194
+
195
+ `https://huggingface.co/WaveCut/orbitquant-packed-matmul/commit/cb0ceb1a4d070556c52cfba691aba3f6647c246b`
196
+
197
+ If a source archive is requested instead, generate it from the Git-tracked
198
+ kernel package path:
199
+
200
+ ```bash
201
+ git archive --format=tar \
202
+ --prefix=orbitquant-packed-matmul/ \
203
+ HEAD:native-kernels/orbitquant-packed-matmul \
204
+ > /tmp/orbitquant-packed-matmul-source.tar
205
+ ```
206
+
207
+ The archive should contain only the tracked source and test files:
208
+
209
+ - `build.toml`
210
+ - `CARD.md`
211
+ - `example.py`
212
+ - `flake.nix`
213
+ - `flake.lock`
214
+ - `benchmarks/benchmark.py`
215
+ - `tests/__init__.py`
216
+ - `tests/test_packed_matmul.py`
217
+ - `torch-ext/orbitquant_packed_matmul/__init__.py`
218
+ - `torch-ext/torch_binding.cpp`
219
+ - `torch-ext/torch_binding.h`
220
+ - `orbitquant_packed_matmul_cuda/packed_matmul.cu`
221
+ - `orbitquant_packed_matmul_metal/packed_matmul.mm`
222
+ - `orbitquant_packed_matmul_metal/packed_matmul.metal`
223
+
224
+ Do not attach generated `build/`, local `.venv/`, `__pycache__/`, or benchmark
225
+ output directories as source material.
226
+
227
+ Purpose:
228
+
229
+ `orbitquant-packed-matmul` implements packed low-bit matrix multiplication for
230
+ OrbitQuant inference. It consumes packed OrbitQuant weight codebook indices,
231
+ per-row norms, Lloyd-Max centroids, and optional bias directly, avoiding a full
232
+ BF16/FP16 dequantized weight matrix before the linear projection.
233
+
234
+ Ecosystem fit:
235
+
236
+ - Primary library: `orbitquant`
237
+ - Target integrations: Hugging Face Diffusers, Hugging Face Transformers, and
238
+ ComfyUI-OrbitQuant
239
+ - Target model families: image and video diffusion transformers, including
240
+ FLUX.2 Klein, FLUX.1-schnell, Z-Image-Turbo, and Wan2.1 T2V
241
+ - Runtime role: default `auto_fused` path prefers this native packed matmul
242
+ package on CUDA/MPS, with explicit `dequant_bf16` available as reference mode
243
+
244
+ Kernel-builder compliance:
245
+
246
+ - Uses `build.toml` and `kernel-builder`
247
+ - Uses ABI3-safe `TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops)` bindings
248
+ - Does not use pybind11, `torch/extension.h`, `setup.py`, or hardcoded
249
+ `torch.ops` namespaces
250
+ - Package tests cover 2/3/4/6-bit packed matmul with and without bias
251
+
252
+ Current build and verification status:
253
+
254
+ - Local kernel-builder CI passed with
255
+ `nix --option sandbox relaxed run .#ci-test -L`
256
+ - Local Metal builds passed ABI compatibility checks for Python ABI 3.9
257
+ - Local MPS OrbitQuant gate passed with `runtime_mode="native_packed_matmul"`
258
+ through `LOCAL_KERNELS`
259
+ - `build-and-copy` currently builds 3 local Metal variants
260
+ - `build-and-upload` finds those 3 variants and then stops at Kernel Hub
261
+ publish permission, which is why publish access is needed
262
+
263
+ Benchmark status:
264
+
265
+ - MPS smoke benchmarks from the local `torch212-metal-aarch64-darwin` package
266
+ variant on Apple Silicon with Torch 2.12.1:
267
+ - W4, 512 rows, 1024 input features, 1024 output features, float16:
268
+ `0.00764581459807232` seconds/iteration over 20 iterations.
269
+ - W4, 512 rows, 3072 input features, 3072 output features, float16:
270
+ `0.10189520000712946` seconds/iteration over 10 iterations.
271
+ - MPS native packed matmul is currently not throughput-competitive with the
272
+ PyTorch baselines on the large local shapes above; treat those values as
273
+ correctness and memory-path evidence only.
274
+ - CUDA native package benchmark evidence is pending a compatible CUDA
275
+ kernel-builder or Kernel Hub build path.
276
+
277
+ Requested approval:
278
+
279
+ Please enable Kernel Hub publish access for the `WaveCut` publisher namespace
280
+ so this package can be uploaded as a `kernel`-type repository and loaded with:
281
+
282
+ ```python
283
+ from kernels import get_kernel
284
+
285
+ kernel = get_kernel(
286
+ "WaveCut/orbitquant-packed-matmul",
287
+ version=1,
288
+ trust_remote_code=True,
289
+ )
290
+ ```