Skip to content

feat(sc): uSystolic stoc_len halving + per-row QK granularity#4

Open
heroarmor wants to merge 1 commit into
CrucibleComputingGroup:mainfrom
heroarmor:feat/sc-halve
Open

feat(sc): uSystolic stoc_len halving + per-row QK granularity#4
heroarmor wants to merge 1 commit into
CrucibleComputingGroup:mainfrom
heroarmor:feat/sc-halve

Conversation

@heroarmor
Copy link
Copy Markdown
Contributor

Adds the uSystolic/HUB sign-magnitude stoc_len halving trick and a per-row QK granularity option to the Q-DiT SC integration.

Changes

  • SCController.halve flag, surfaced as --sc_halve (and SC_HALVE=1 env). When set, bipolar SC matmuls run at stoc_len/2 via halve_bipolar_stoc_len=True — no accuracy loss. No-op for non-bipolar modes and the noise surrogate.
  • SCAttention / SCMlp route through partial(sc_matmul, halve_bipolar_stoc_len=True) when halve is enabled.
  • --sc_qk_granularity {per_head,per_row}: per-row QK scaling to match the AV path (default stays per_head).
  • tools/kernel_launch_counter.py: point the DiT ckpt at the turbo path.
  • Bump scmp_kernels submodule to a576b83 (already on upstream/main).

Debug/scratch tools were intentionally left out of this PR.

🤖 Generated with Claude Code

- SCController.halve flag (--sc_halve / SC_HALVE env): run bipolar SC matmuls
  at stoc_len/2 via halve_bipolar_stoc_len, no accuracy loss; no-op for
  non-bipolar modes and the noise surrogate
- SCAttention/SCMlp route through partial(sc_matmul, halve_bipolar_stoc_len=True)
  when halve is set
- --sc_qk_granularity {per_head,per_row}: per-row QK scaling to match the AV path
- kernel_launch_counter: point DiT ckpt at the turbo path
- bump scmp_kernels submodule to a576b83 (on upstream/main)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@heroarmor
Copy link
Copy Markdown
Contributor Author

@Allenjin123 PTAL when you have a chance — same uSystolic halving work as the llama/spec-decode PRs, on the Q-DiT SC path. (Couldn't add you via the reviewer field from my fork.)

@heroarmor
Copy link
Copy Markdown
Contributor Author

GIVE ME THE WRITE ACCESS PLS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant