Open
Conversation
- Replace Flash Attention 3 with PyTorch SDPA (F.scaled_dot_product_attention) - Remove kernels dependency - Downgrade PyTorch 2.9.1 -> 2.5.1+cu121 (last version supporting sm_61) - Switch bfloat16 -> float16 (Pascal lacks bf16 support) - Disable torch.compile (Triton requires sm_70+) - Rewrite optimizer steps for eager mode with float32 master weights - Reduce model size for 6GB VRAM: DEPTH 4, DEVICE_BATCH_SIZE 8, TOTAL_BATCH_SIZE 32K, MAX_SEQ_LEN 512, WINDOW_PATTERN L - Reduce EVAL_TOKENS for faster validation Verified: trains to completion in ~6min, 985MB VRAM, val_bpb ~3.21
- Add detect_gpu_config() that queries GPU compute capability and VRAM - 4 tiers: high (H100/A100 40GB+), mid-high (RTX 4090/3090 16GB+), mid (RTX 3070/2080 8GB+), low (GTX 1060 <8GB) - Auto-select: attention backend (FA3 vs SDPA), dtype (bf16 vs fp16), torch.compile (sm_70+ only), model depth, batch sizes, seq length - FA3 restored as optional dep for Ampere/Hopper GPUs - prepare.py reads MAX_SEQ_LEN/EVAL_TOKENS from env vars set by train.py - Optimizer supports both compiled (CPU tensor) and eager (float32) paths
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.
Verified: trains to completion in ~6min, 985MB VRAM, val_bpb ~3.21