Repository navigation
Harden real-GPU paths and add end-to-end GPU test suite - #29
Merged
Merged
Conversation
Audit-driven fixes across loading, generation, fine-tuning, export, serving, Hub and packaging, verified on real GPUs (Kaggle 2x T4, torch 2.11 / transformers 5.16 / bitsandbytes 0.50): 23 passed, 1 skipped. Highlights: - Export no longer discards fine-tuned weights (in-memory dequantize, correct 8-bit SCB scaling, LoRA merged before ONNX/MLX staging) - trust_remote_code defaults to False everywhere; CLI --trust-remote-code - Load errors re-raised with the real cause instead of blaming architecture - Generation: no double BOS, multi-EOS respected, native stop strings, streaming errors propagate instead of hanging - Fine-tuning: transformers 5 compatible (no warmup_ratio), kwargs override defaults, correct LoRA targets, EOS/pad handling, adapter saved, final_loss - Server: non-blocking endpoints, model lock, OpenAI-compatible streaming - GGUF: converter deadlock, Windows .exe paths, real bf16/f32 outtype, no temp files in cwd, imatrix support - HQQ: real half-quadratic zero-point optimization; non-divisible groups - Hub: private repos honored, existing model cards preserved, hub 1.x registry - Packaging: optimum-onnx extra, transformers>=4.46, no git-URL extra GPU testing: - tests/gpu: behavioural E2E suite on a real model (skips without CUDA) - scripts/kaggle_gpu_tests.py: run the working tree on Kaggle's free GPUs - scripts/modal_gpu_tests.py, scripts/run_gpu_tests.sh, GPU E2E workflow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
An audit of the whole codebase found ~70 real-world bugs, mostly on GPU and real-model paths that the CPU-only tests never exercised. This PR fixes them and adds a behavioural GPU test suite that runs for free on Kaggle.
Verified on real GPUs: Kaggle 2× Tesla T4 with torch 2.11 / transformers 5.16 / bitsandbytes 0.50 / Python 3.13. Two consecutive full runs gave 23 passed, 1 skipped (ONNX skips because
optimum-onnxdoesn't support transformers 5 yet). CPU suite: 232 passed. ruff and mypy are clean.Key fixes
trust_remote_codeis now off by default inturbo(), model analysis, GGUF loading and the server. The CLI gets a--trust-remote-codeflag.attn_implementationbeing set at load time, and the default of 16-bit when there's no GPU.warmup_ratiowas removed), extra kwargs override the defaults, LoRA target modules are correct, EOS/pad tokens are handled, the adapter is saved, and the result includesfinal_loss..exepaths. bf16/f32 output types are now real, temp files no longer land in the current directory, and imatrix is supported.private=Trueis respected, existing model cards are preserved, and the registry works with huggingface_hub 1.x.optimum-onnx,transformers>=4.46, the git-URL extra is removed, and the version-awaredtype/torch_dtypehelper silences the transformers 5 deprecation.GPU testing
tests/gpu/: an end-to-end suite on a real model that checks behaviour. It skips itself when there's no CUDA.python scripts/kaggle_gpu_tests.py [--slow]: packs the working tree, runs it on Kaggle's free GPUs, downloads the results, and warns if Kaggle substituted a different GPU.scripts/modal_gpu_tests.py,scripts/run_gpu_tests.sh, and a manual or PR-label-triggeredGPU E2Eworkflow.Not covered yet
🤖 Generated with Claude Code