Skip to content

docs: add Tesla T4/Turing hardware notes (attn-impl, dtype, quantization)#26

Open
moduvoice wants to merge 1 commit into
AutoArk:mainfrom
moduvoice:docs/t4-turing-notes
Open

docs: add Tesla T4/Turing hardware notes (attn-impl, dtype, quantization)#26
moduvoice wants to merge 1 commit into
AutoArk:mainfrom
moduvoice:docs/t4-turing-notes

Conversation

@moduvoice

Copy link
Copy Markdown

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:

  1. --attn-impl auto crashes on Turing GPUs. inference/model_loader.py::normalize_attn_impl returns flash_attention_2 for any cuda* device with no torch.cuda.get_device_capability() check and no check that flash-attn is even installed (it's commented out as an optional extra in pyproject.toml, not in requirements.txt). Following the Quick Start as-is on T4 fails at model load with:

    ImportError: FlashAttention2 has been toggled on, but it cannot be used due to the following error:
    the package for FlashAttention2 doesn't seem to be installed.
    

    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 sdpa first so users don't need to give up the GPU.

  2. No --dtype CLI flag. --device and --attn-impl are exposed as CLI args, but dtype is hardcoded to torch.bfloat16 on CUDA in model_loader.py. Documented that this is measurably suboptimal on T4: PyTorch's SDPA EFFICIENT_ATTENTION kernel rejects bfloat16 and silently falls back to the slower MATH path, while fp16 reaches EFFICIENT_ATTENTION directly (per-token latency was within noise in our runs, but only fp16 hits the faster kernel on this GPU class).

  3. bitsandbytes int8 quantization trade-off. Not mentioned anywhere in the docs today. Measured BitsAndBytesConfig(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.

  4. 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

  • Ran GPA_1.5/infer.py --task asr and --task tts end-to-end on a Tesla T4 16GB with --attn-impl sdpa: both complete successfully (ASR transcript correct, TTS produces a valid wav).
  • Reproduced the flash_attention_2 ImportError with the default --attn-impl auto on the same box (2 runs, deterministic).
  • Measured peak VRAM and per-token decode time for bf16/fp16/int8 via the repo's own AutoModelForCausalLM/BitsAndBytesConfig APIs (no repo code modified), each reproduced twice.
  • This PR only touches GPA_1.5/docs/infer.md; no source files changed.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant