huggingface / huggingface/diffusers

Add AMD Quark support to Diffusers

Aperta
#14,149 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature-request models quantization
Lingua principale
Python
Stelle
34.5k
Fork
7.3k
Merge medio
3g 3h
PR unite (30g)
91

Descrizione

Is your feature request related to a problem? Please describe.
Diffusers cannot load or run AMD Quark-quantized diffusion models through the standard from_pretrained APIs Today the only way to use a Quark-quantized UNet/transformer with Diffusers is to monkey-patch Quark into the auto-quantizer mappings at runtime, which is fragile and breaks when Diffusers internals change.
Describe the solution you'd like.
We would like to add Quark to AUTO_QUANTIZER_MAPPING (like bitsandbytes, GGUF, torchao, quanto, ModelOpt).
This would mean QuantizationMethod.QUARK, QuarkConfig, and QuarkDiffusersQuantizer would be registered in AUTO_QUANTIZER_MAPPING / AUTO_QUANTIZATION_CONFIG_MAPPING. There would be two load paths -- prequantized reload as well as online quantization. This also adds the optional amd-quark dependancy.

Describe alternatives you've considered.
We have tried runtime monkey-patching from Quark-side (currently in place).

Additional context.
This mirrors https://huggingface.co/docs/transformers/quantization/quark (the existing Transformers Quark integration). Implementation is ready at #14077.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando l’implementazione referenziata in #14077 e le API standard from_pretrained, quindi ispeziona AUTO_QUANTIZER_MAPPING e AUTO_QUANTIZATION_CONFIG_MAPPING. Il lavoro è completato quando QuarkConfig, QuantizationMethod.QUARK e QuarkDiffusersQuantizer supportano sia il ricaricamento di modelli prequantizzati sia la quantizzazione online con la dipendenza opzionale amd-quark.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python, pytorch
Ambito
machine-learning
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.