huggingface / huggingface/diffusers

[optimization] help us know which kernels we should integrate in Diffusers

Offen
#12,990 13 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
performance
Vorherrschende Sprache
Python
Sterne
34.5k
Forks
7.3k
Ø Merge
3 T. 3 Std.
Gemergte PRs (30 T.)
91

Beschreibung

This issue is for knowing which kernels we should integrate into the library through [`kernels`](https://github.com/huggingface/kernels/).

Currently, we leverage `kernels` for different attention backends (FA2, FA3, and SAGE). However, other layers can be optimized as well (RMS Norm, for example), depending on the model size and input payload being used to benchmark that.

I did take a crack at this once, i.e., replacing the norm layers with their optimized counterparts, but didn't realize any noticeable gains. But maybe this is different now.

## Resources / notes

* There's a bunch of kernels we maintain in https://huggingface.co/kernels-community, which could be repurposed in this case.
* We can also work together with the community to port impactful kernels and host them through https://huggingface.co/kernels-community and make sure they are `kernels` compatible.
* `transformers` gain benefits from this paradigm in terms of latency improvements (@MekkCyber can provide details). Some relevant PRs can be found here: https://github.com/huggingface/transformers/commits?author=MekkCyber (look for PRs with titles starting with "[kernels]")

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Es werden keine Dateien oder Tests genannt. Beginne damit, die bestehende Integration von kernels für FA2, FA3 und SAGE zu überprüfen, und benchmarke anschließend Kandidaten wie RMS Norm über verschiedene Modellgrößen und Eingabepayloads hinweg. Als abgeschlossen gilt die Identifizierung von kernels mit merklichen Verbesserungen und die Bestimmung, welche sich für die Integration über kernels eignen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, pytorch
Bereich
machine-learning, performance
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.