fix(ci): gate fastokens benches behind RUN_BENCH#11630
Conversation
|
👋 Hi renflowerz! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
a46c9b1 to
61a6e32
Compare
WalkthroughThe pre-merge workflow caches, validates, downloads, and passes a Qwen tokenizer to root-directory Rust tests through ChangesQwen tokenizer CI preparation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
This comment has been minimized.
This comment has been minimized.
61a6e32 to
ae62367
Compare
ae62367 to
5740458
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/pre-merge.yml:
- Line 190: Update the tokenizer download curl command in the pre-merge workflow
to include explicit connection and overall transfer timeouts, while preserving
its existing retry, URL, and output-file behavior.
- Around line 166-171: Update the “Cache Qwen tokenizer” step to use a
repair-capable cache flow: avoid restoring the corrupted exact-key entry, and
save the successfully redownloaded tokenizer under a distinct repair-specific
key or otherwise ensure the healed file replaces the bad cache. Preserve the
existing path and root-directory condition while making subsequent runs restore
the repaired tokenizer.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: bd9f32d4-eabf-4bdf-9bf1-bf9b4fafa45f
📒 Files selected for processing (1)
.github/workflows/pre-merge.yml
5740458 to
bcd06be
Compare
|
@coderabbitai full review |
✅ Action performedFull review finished. |
bcd06be to
2d31acb
Compare
2d31acb to
ec8fbaa
Compare
ec8fbaa to
37875d8
Compare
The fastokens benches in tokenizer_simple download a production-size Qwen tokenizer from Hugging Face at runtime. Under `cargo test --all-targets` (CI pre-merge) this makes the root Rust test job depend on Hugging Face availability: a transient Xet/CAS 403 broke both main and an unrelated PR. Gate the two fastokens benches behind RUN_BENCH=1, matching the existing opt-in pattern in tokenizer_dataset.rs. The remaining benches in the file use in-tree tokenizers and keep running in CI. Signed-off-by: Renan Florez <florez.renan@gmail.com>
37875d8 to
c7fec6e
Compare
Overview:
Gate the two fastokens benches in
tokenizer_simplebehindRUN_BENCH=1socargo test --all-targetsin CI no longer depends on a Hugging Face download.Details:
cargo test --all-targetsexecutestokenizer_simple, whose two fastokens benches downloadQwen/Qwen3-0.6Bfrom Hugging Face at runtime. A transient Hugging Face Xet/CAS 403 caused the same failure on bothmain(run 29290753192) and an unrelated PR (run 29291246536).Per review discussion, the fix is to gate the network-dependent benches instead of caching the tokenizer in CI:
fastokens_encodeandfastokens_batch_encodenow skip unlessRUN_BENCH=1is set, matching the existing opt-in pattern intokenizer_dataset.rscargo test --all-targetsWhy not an in-tree tokenizer: the fastokens parity check needs a byte-level BPE tokenizer (ByteLevel pre-tokenization, GPT/Qwen style). TinyLlama (the only real tokenizer in
tests/data) is BPE but sentencepiece-style (metaspace + byte-fallback, no pre-tokenizer), which fastokens does not handle, and the byte-level mocks have empty vocabs. If the fastokens-vs-HF parity assertion is wanted back in CI later, a small trained byte-level BPE mock intests/datawould be the way (possible follow-up).Validation:
RUN_BENCHunset: both fastokens benches print a skip message and return, no network accessRUN_BENCH=1: behavior unchanged from beforeWhere should the reviewer start?
lib/llm/benches/tokenizer_simple.rs: theRUN_BENCHguards at the top offastokens_encodeandfastokens_batch_encode.Related Issues
🚫 This PR is NOT linked to an issue: