Repository navigation
feat(tools): 5-item GPU fast-kernel toolkit (freesilicon/.github#1) & 7-slot Colab fleet dispatcher - #37
Merged
Conversation
…t dispatcher Add clean-room GPU training/RL acceleration primitives (freesilicon/.github#1) and a 7-slot headless Google Colab fleet dispatcher with dual sync and a two-stage Compute Unit governor: - tools/h100_fast_kernels.py & tools/test_h100_fast_kernels.py: 1. causal-conv1d prebuilt-wheel helper with graceful PyTorch fallback 2. Architecture-safe liger-kernel RMSNorm / softcap=30.0 fused CE guards plus VRAM-aware gradient_checkpointing toggle (auto-off >= 70 GiB) 3. Dynamic SFT sequence packing (max_len=2048, 4D block-diagonal causal mask, sconv_guard=3 zero cross-example leak) 4. Fused 64-expert MoE GroupedGEMM (torch._grouped_mm + ExpertLoRA, verified 9.54x speedup at 2048 tokens with 0.0 forward error on L4) 5. FastRolloutEngine (colocated vLLM sleep-mode / torch.compile CUDA graphs + eager fallback), opt-in Hopper FP8 guard, and content-addressed StartupArtifactCache - tools/colab_fleet.py & tools/test_colab_fleet.py: - 7-slot concurrent dispatcher (GPU <= 3 with H100->A100_HM->A100->L4->T4_HM fallback, TPU <= 2 V6E1->V5E1, High-RAM CPU workers) preserving pre-existing external sessions and enforcing fleet-* isolated teardown - Dual pluggable sync: --sync local (default, zero cloud keys on Colab) and --sync s3 (generic S3-compatible R2/GCS HMAC via stdlib SigV4 env vars) - Two-stage CU governor: sprint mode down to --floor-cu 500, then steady-state --steady-daily-cap-cu 65 with work-admission gating - docs/cloud-tpu/colab-fleet-and-fast-kernels.md & .github/workflows/ci.yml Ref: freesilicon/.github#1 Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
Avoid evaluating @torch.no_grad() at class definition time when PyTorch is absent on stdlib-only CI runners. Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
Ignore Rich traceback source-context lines (e.g. 'except TooManyAssignmentsError:') when classifying HTTP 503 Service Unavailable responses so SKU fallback proceeds cleanly. Signed-off-by: Bobby Bones <saariuscrypto@gmail.com>
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.
Summary
Implements all 5 training & RL acceleration items tracked in freesilicon/.github#1 together with a clean-room 7-slot Google Colab fleet dispatcher, dual sync backends, and a two-stage Compute Unit governor.
What's Included
tools/h100_fast_kernels.py+tools/test_h100_fast_kernels.py(stdlib-safe--help/--self-testeven without PyTorch):ensure_causal_conv1d(): prebuilt binary wheel preference + graceful PyTorchF.conv1dfallback.configure_liger_and_checkpointing(): Inkling-2-safeliger-kernelguards (unweighted value norm, SiTU 4.0/25.0, no-RoPE,final_logit_softcapping=30.0, VRAM-gated fused CE recommendation) + VRAM-awaregradient_checkpointingtoggle (auto-off>= 70 GiB).pack_sft_sequences(): FFD dynamic sequence packing (2048block-diagonal causal mask +sconv_guard=3for mathematically0.0cross-example leak).grouped_moe_dispatch()&patch_inkling2_experts_with_grouped_mm(): fusedtorch._grouped_mm64-expert MoE +ExpertLoRAwith bit-exact eager fallback.FastRolloutEngine(colocated vLLM sleep-mode /torch.compileCUDA graphs + eager fallback), opt-in HopperFP8guard (configure_hopper_fp8), and content-addressedStartupArtifactCache.tools/colab_fleet.py+tools/test_colab_fleet.py:7concurrent slots respecting pre-existing external sessions (GPU<= 3withH100 -> A100_HM -> A100 -> L4 -> T4_HMfallback & zero412/503retry hammering; TPU<= 2V6E1 -> V5E1; High-RAM CPU workers).--sync local(default, zero cloud keys on Colab) and--sync s3(generic S3/R2/GCS HMAC via stdlib AWS SigV4 env vars, zero secrets logged).--floor-cu 500, then auto-throttle to--steady-daily-cap-cu 65(~2,000 CU/morollover) with work-admission gating (0idle burn).STATE.md,events.jsonl,heartbeat,PROOF.md, and isolatedfleet-*-only teardown.docs/cloud-tpu/colab-fleet-and-fast-kernels.md&.github/workflows/ci.ymlCI wiring.Live Colab GPU Proof (
NVIDIA L4,sm_89,PyTorch 2.14.1+cu130,2.33 CU/hr)causal-conv1d(sconv_k=4, H=2304, T=2048)0.969 msF.conv1dfallback (nocp313+cu130wheel)0build stallRMSNorm1.413 ms0.802 ms(12/12unweighted skipped)1.76×max_abs=0.015625vocab=201k, softcap=30)126.0 ms,5,116.6 MiB1,007.0 ms,2,082.0 MiB-3.03 GiBVRAM (auto-recommended< 35 GiBonly)loss diff = 1e-6gradient_checkpointingtoggle105.37 ms(GC on)72.96 ms(GC off, auto>= 70 GiB)1.44×loss diff = 0.0128ex →9×2048,sconv_guard=3)236.87 ms(69.0k tok/s)129.30 ms(126.4k tok/s,97.9%density)1.83×(14.22×fewer steps)0.0attn/sconv leakGroupedGEMM(E=64, K=8, H=2304, I=1152, LoRA r=16)119.6 ms(512) /470.9 ms(2048)27.5 ms(512) /49.3 ms(2048)4.35×→9.54×max_err=0.0,cos=1.0torch.compiledecode + FP8 guard + Startup Cache76.7 mseager75.7 mscompiled ·sm_89safe BF16 ·24.1 mscache hitgreedy_exact=trueVerification
python3 tools/h100_fast_kernels.py --self-test&python3 tools/test_h100_fast_kernels.py -v: 6/6 PASSpython3 tools/colab_fleet.py --self-test&python3 tools/test_colab_fleet.py -v: 5/5 PASS