docs: add Tesla T4/Turing hardware notes (attn-impl, dtype, quantization)#26
Open
moduvoice wants to merge 1 commit into
Open
docs: add Tesla T4/Turing hardware notes (attn-impl, dtype, quantization)#26moduvoice wants to merge 1 commit into
moduvoice wants to merge 1 commit into
Conversation
…ion) Documents behavior measured on a real Tesla T4 16GB (Turing, sm_75): - --attn-impl auto unconditionally resolves to flash_attention_2 on any CUDA device with no GPU-capability check, crashing with an ImportError on T4/other Turing GPUs at model load. Recommends --attn-impl sdpa, which is already a supported CLI value and works correctly. - There is no --dtype CLI flag; dtype is hardcoded to bf16 on CUDA. Notes this is suboptimal on T4 since SDPA's EFFICIENT_ATTENTION kernel rejects bf16 and falls back to the slower MATH path. - bitsandbytes int8 quantization does reduce VRAM (~43%) but makes batch=1 decode ~3.2x slower — documented as a real trade-off. - Notes the 0.6B model has ample VRAM headroom on T4 16GB (~4GB peak). No code changes.
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.
Motivation
Ran the GPA-v1.5 native infer Quick Start (
GPA_1.5/docs/infer.md) verbatim on a real Tesla T4 16GB (Turing, sm_75; driver 550.163.01 / CUDA 12.4, torch 2.6.0+cu124, transformers 5.13.0) and hit a crash the docs don't mention, plus found a couple of undocumented behaviors worth calling out for anyone on Turing-class GPUs (T4, similarly L4).Changes
Doc-only additions to
GPA_1.5/docs/infer.md— no code changes:--attn-impl autocrashes on Turing GPUs.inference/model_loader.py::normalize_attn_implreturnsflash_attention_2for anycuda*device with notorch.cuda.get_device_capability()check and no check thatflash-attnis even installed (it's commented out as an optional extra inpyproject.toml, not inrequirements.txt). Following the Quick Start as-is on T4 fails at model load with:Documented the fix: pass
--attn-impl sdpa(already a supported CLI value, no code change) — both ASR and TTS complete normally. Also corrected the "Fast Troubleshooting Data preparation files are missing #5" section, which previously only suggested falling back to--device cpu; now it points to--attn-impl sdpafirst so users don't need to give up the GPU.No
--dtypeCLI flag.--deviceand--attn-implare exposed as CLI args, but dtype is hardcoded totorch.bfloat16on CUDA inmodel_loader.py. Documented that this is measurably suboptimal on T4: PyTorch's SDPAEFFICIENT_ATTENTIONkernel rejectsbfloat16and silently falls back to the slowerMATHpath, whilefp16reachesEFFICIENT_ATTENTIONdirectly (per-token latency was within noise in our runs, but only fp16 hits the faster kernel on this GPU class).bitsandbytesint8 quantization trade-off. Not mentioned anywhere in the docs today. MeasuredBitsAndBytesConfig(load_in_8bit=True)reducing peak VRAM by ~43% (2317 MB → 1327 MB, reproduced twice) but making batch=1 autoregressive decode ~3.2x slower (≈36–39 ms/token → ≈121–125 ms/token, reproduced twice). Documented as a real trade-off rather than a free win.VRAM headroom note. The native infer path uses a 0.6B backbone; full-pipeline peak VRAM measured ≈4.0–4.2 GB (bf16/fp16) / ≈3.0–3.1 GB (int8) — roughly 74–81% of a T4's 16GB unused. Noted this so T4/L4 users know OOM isn't a practical concern here.
Testing
GPA_1.5/infer.py --task asrand--task ttsend-to-end on a Tesla T4 16GB with--attn-impl sdpa: both complete successfully (ASR transcript correct, TTS produces a valid wav).flash_attention_2ImportErrorwith the default--attn-impl autoon the same box (2 runs, deterministic).AutoModelForCausalLM/BitsAndBytesConfigAPIs (no repo code modified), each reproduced twice.GPA_1.5/docs/infer.md; no source files changed.