AITemplate icon indicating copy to clipboard operation
AITemplate copied to clipboard

[ask] is it possible to copy weights from PyTorch model to complied AIT model

Open YaoAstro opened this issue 1 year ago • 2 comments

I have a group of fine-tuned stable diffusion models using the same training process. After compiling one model into AIT format, is it possible to reuse the "selected" AIT graph for other models by directly copying weights over (as opposed to compiling all the other models)?

YaoAstro avatar Mar 10 '23 22:03 YaoAstro

Hi @YaoAstro,

Such functionality should be more or less working though not very well documented. However, you can refer to this test to get some idea https://github.com/facebookincubator/AITemplate/blob/32a846507b129003c26600b1bcbe98f93aebcefe/tests/unittest/compiler/test_constant_folding.py#L543.

cc @muchulee8

khabinov avatar Mar 10 '23 23:03 khabinov

Thanks for the pointer, @khabinov!

YaoAstro avatar Mar 14 '23 23:03 YaoAstro