Conversation
|
Both touched files lose their trailing newline, which fails
Re-adding the newline to both files is all that is needed. The Two smaller notes:
|
…dels (mudler#11875) ImportModel hands the copied GGUF to importers.ImportLocalPath, which detects the file format and defaults every GGUF to `backend: llama-cpp`. For a model this service just produced with a backend stock llama.cpp cannot read, the generated config names an engine that cannot load the file, and the import silently registers an unloadable model. Correcting `backend:` by hand makes the same file work. The job record already carries the backend that served StartQuantization, so carry it into the config instead of keeping the detected default. The gallery publishes a quantizer as a release channel of the engine that runs its output ("llama-cpp-quantization" is llama.cpp's quantizer, whose GGUF is served by "llama-cpp"), so the channel suffix is stripped to get the serving backend. A backend that both quantizes and serves ("rocmfp4") carries no suffix and passes through unchanged, as do pinned hardware variants ("rocm-rocmfp4"), which are valid values for a config's backend field. An empty job backend leaves the detected default in place. Also replace the importer's generic "Fine-tuned model (GGUF)" description for this path: the model was quantized, not fine-tuned, and the job knows the type. Signed-off-by: Tai An <antai12232931@outlook.com>
bf6c642 to
8304e1e
Compare
Signed-off-by: Anai Guo <antai12232931@outlook.com>
|
Thanks for the careful review! Restored the trailing newline on |
|
Thanks for this PR! The DCO check is failing because the commits are not signed off. Please amend your commits with |
|
Code review: the Two minor notes:
|
Fixes #11875.
Problem
QuantizationService.ImportModelcopies the finished GGUF into the models directory and then callsimporters.ImportLocalPathto generate the config. That importer detects the file format and hardcodes the backend for any GGUF:ImportModelthen only overridescfg.Name, so the job's own backend is discarded. For a model this service just quantized with a backend whose weight types stock llama.cpp does not know (the reporter hit this withrocmfp4, ROCmFP4 types from #11636), the generated YAML names an engine that cannot load the file. The import reports success and registers a model that fails at load; correctingbackend:by hand makes the same file work immediately.The one path that produces a model and the one path that registers it disagree about how to run it.
Fix
The job record already carries the backend that served
StartQuantization(schema.QuantizationJob.Backend), so carry it into the config instead of keeping the detected default.Copying
job.Backendverbatim would be wrong for the common case, because the gallery publishes a quantizer as a release channel of the engine that serves its output —llama-cpp-quantizationis llama.cpp's quantizer, and the GGUF it writes is served byllama-cpp. That convention is already stated incore/config/backend_capabilities.go:So the new helper strips that suffix (after
config.NormalizeBackendName, which foldsllama.cpp→llama-cpp):job.Backendbackend:llama-cpp-quantizationllama-cpprocmfp4rocmfp4rocm-rocmfp4-quantizationrocm-rocmfp4backend:valuellama.cpp-quantizationllama-cpp""Both cases the reporter actually hit come out right.
I deliberately kept this inside
core/services/quantization.stripBackendVariantincore/configdoes the same job and also strips hardware prefixes, but it is unexported; if you would rather export it and call it here (which would additionally reducerocm-rocmfp4torocmfp4), say so and I will switch — I did not want to widen a package's API unasked.Also addresses the secondary point in the issue: the description said
Fine-tuned model (GGUF)for a model that was quantized, not fine-tuned. This path now writesQuantized model (<type>, GGUF), guarded so an empty type leaves the importer's text alone. The generic importer is untouched.Verification
Added five specs to
core/services/quantization/service_test.go(existing ginkgo white-box suite) covering exactly the table above.The mapping was also run standalone against the real logic:
gofmt -lis clean on both changed files. I do not have a ROCm host, so the end-to-end quantize→import round trip onrocmfp4is not something I could re-run; the failing artifact and the hand-corrected YAML in the issue are the ground truth I worked from.🤖 Generated with Claude Code