Lightning-AI/lightning-thunder

Make autocast a Transform

Aperta

#1122 aperta il 7 set 2024

 (2 commenti) (0 reazioni) (0 assegnatari)Python (114 fork)github user discovery
enhancementgood first issue

Metriche repository

Star
 (1460 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Currently autocast (transforms/autocast.py) is carried over from the old-style transforms on callable and invoked like

jit(autocast(fn))

it would be good to make this a AutocastTransform to be invoked as

jit(fn, transforms=[Autocast()])

for better composability.

This should be vaguely doable with the transforms e.g. as explained in Thunder Sessions Episode 7 plus the bsym mapping provided by the existing mechanism, so it might be a good first or second issue.

Guida contributor