fix(kernel): unbreak the nightly kernel-cache wheel build - #310
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nightly wheels are red since 08-29 (run 33308036999): the
freetoken-kernel-cachewheel no longer builds. Two breakages, both from #257.1.
freetoken.kernel.aotimportsfreetoken.moeexpert_bank_row_bytesimportedfp8_block_scale_padfromfreetoken.moe.offload_cache, andaot.pyevaluates its spec tables at module import. That pulls infreetoken.utils->huggingface_hub, which the isolated build env (torch + tvm-ffi only) does not have.Fix: move the helper into
kernel/aot_models.pyand invert the import. Byte values unchanged.2. AOT specs the per-bank kernel cannot compile
fast_index_copycopies 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=0hits 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.