very good project on NPU

#1
by ikaroso - opened

I found out the optimization of MTP, using 128 tokens for prefill, not the whole input prompt, and the accept rate is still good.

Thank you! Agreed - the drafts only need the recent context. onwx already does this: the MTP rows are built from the last 512 prompt tokens only (ONWX_MTP_ROWS, default 512), not the whole prompt. On our side the extra cost of 512 vs 128 is small (one MTP layer next to the 32 layers of the 9B), so we keep 512 as the safer default, but you can set ONWX_MTP_ROWS=128 if you like.

Correction to my reply above: I checked the released code and the default is already 128, not 512 (512 was an older dev build; ONWX_MTP_ROWS, about 3.5 ms per row, so 128 saves ~1.3 s on long prompts). So the released onwx does exactly what you found - thanks for confirming that 128 keeps a good accept rate!

Correction to my reply above: I checked the released code and the default is already 128, not 512 (512 was an older dev build; ONWX_MTP_ROWS, about 3.5 ms per row, so 128 saves ~1.3 s on long prompts). So the released onwx does exactly what you found - thanks for confirming that 128 keeps a good accept rate!

Yes, and this is very insightful. I have also seen your two-amd-distributed framework, also very inspiring.

Sign up or log in to comment