Skip to content

fix(kernel): unbreak the nightly kernel-cache wheel build - #310

Merged
jason-fxz merged 3 commits into
mainfrom
fix/aot-models-no-moe-import
Aug 31, 2026
Merged

fix(kernel): unbreak the nightly kernel-cache wheel build#310
jason-fxz merged 3 commits into
mainfrom
fix/aot-models-no-moe-import

Conversation

@jason-fxz

Copy link
Copy Markdown
Collaborator

Nightly wheels are red since 08-29 (run 33308036999): the freetoken-kernel-cache wheel no longer builds. Two breakages, both from #257.

1. freetoken.kernel.aot imports freetoken.moe

expert_bank_row_bytes imported fp8_block_scale_pad from freetoken.moe.offload_cache, and aot.py evaluates its spec tables at module import. That pulls in freetoken.utils -> huggingface_hub, which the isolated build env (torch + tvm-ffi only) does not have.

Fix: move the helper into kernel/aot_models.py and invert the import. Byte values unchanged.

2. AOT specs the per-bank kernel cannot compile

fast_index_copy copies rows in fixed 128-byte steps (static_assert, no tail handling), so row sizes must be a multiple of 128. Qwen3.8-Flash-Next's padded fp8 scale banks (240/400 B) are the first supported sizes to violate this, so the build would next die compiling those two specs; FREETOKEN_FUSED_COPY=0 hits the same static_assert at runtime JIT.

Fix: filter non-128 sizes out of the AOT aggregation (such banks are only ever moved by the fused multi-bank kernel, which needs 16 B), and fail fast at bank registration when the fused plan is off and a bank cannot take the per-bank fallback.

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

Labels

None yet

1 participant