Fix torch.compile crash in generating triton code for normalise_grad - #1
Conversation
dtype mismatch between tensor and python float
|
@lkhphuc Thanks a lot and sry for some reason I did not see this PR. So the problem appears to be the full_graph compile decorator here https://github.com/SDLAML/disco/blob/main/disco/abstract_disco.py#L92 After some point in the latest PyTorch version, it is broken. |
|
Thanks a lot. sry again for the late merge. I did test and it works well for me. ( |
|
hey @lkhphuc i think i have to revert these changes, not your code's problem, but compile. (i will find time after vacation to refactor code to fix it ) There is a stupid and annoying bug in Torch compile. The current logic for LLM's embedding/head is, AT most of the time, we do BUT, when we try to "track" the norm of the update/weights of head/output, we gather it and run This works well until a certain step, about 260-270 steps, the compile decides to replace the (good thing is it seems only affect to logging for tracking, no bother with actual training dynamic) |
dtype mismatch between tensor and python float when pytorch generate this triton code.
Fixed it by explicitly convert to Tensor and uses torch primitive.
I'm using Triton comes with Pytorch nightly btw.