New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: linearizer support multiple sets of accumulators #4419
base: master
Are you sure you want to change the base?
Conversation
I'm not sure if I'm missing some details. @0xtimmy thoughts? or feel free to just do it yourself. I think loaded_buffers need to be scoped per sequential loop. |
the i think it looks good |
seems like accs and loaded_buffers kind of the same thing |
looks good, can you resolve the conflicts? |
tinygrad/codegen/linearizer.py
Outdated
return acc | ||
for u in self.ast_parse(x.src[0], accs, offs, loaded_buffers)] | ||
if x.op in ReduceOps and do_reduce is None: | ||
return [accs[x][i] for i in offs] if offs is not None else accs[x] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you bring back the assert? we only need this when there are multiple reduceops.
return [accs[x][i] for i in offs] if offs is not None else accs[x] | |
assert offs is None, "not available if we aren't doing reduce" | |
return accs[x] |
I think deleting asserts is a behavior change
It's hard to test this because there is no interface behavior change. Thus the future behavior changes need to be careful not to use this wrong. Maybe I am not refactoring these things in the correct order. |
This branch currently is behind tinygrad/master. The line count difference bot is disabled. |
No description provided.