-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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] Create a fresh new Context for args+earg+rets per-launch #1739
Comments
struct Context
, make arg+ret buffer read-and-write like gtmp doesstruct Context
, add program->ctx_buffer read-and-write like gtmp does, unify args and earg
struct Context
, add program->ctx_buffer read-and-write like gtmp does, unify args and eargstruct Context
, add stationary program->ctx_buffer read-and-write like gtmp does, unify args and earg
struct Context
, add stationary program->ctx_buffer read-and-write like gtmp does, unify args and eargstruct Context
, add stationary program->ctx_buffer like gtmp does, unify args and earg
Yes, you've listed out my plan, so I don't have too much to supplement. There won't be
I hear your concerns. As I have explained in #1724 (review), this will not affect how OpenGL implements the input args/return value SSBOs. That is, it is perfectly fine for OpenGL to use a single SSBO to pass in the input args, and have the OpenGL shader to write back the return value to that SSBO. (Actually I believe Metal is doing the same thing here). All that a backend needs to change is, instead of copying the data from SSBO to To conclude, this shouldn't affect how a backend runtime implements its input/output with that backend's shaders, but does affect how a backend runtime should pass that output back to the Taichi program runtime.
+1, this is a good point. I think we should move it to a more generic place, e.g.
Not really. |
So, after the |
struct Context
, add stationary program->ctx_buffer like gtmp does, unify args and earg
I think we could, but it might take much more effort to decouple IMHO it might be better to get all the backends aligned on how I'd also like to confirm on my understanding that switching to |
What's the downside and difficulty of decoupling
OOK, so the is CUDA and CPU using print buffer like we did in Metal and OpenGL? I.e. string table?
Yes it doesn't create (with some mocks). I don't feel like these dirty mocks. |
(Cont. #1722)
Concisely describe the proposed feature
It seems @k-ye's plan is:
ctx->args
for passing arguments.ctx->extra_args
for passing extra arguments.program->result_buffer
for passing return values.And my plan is:
program->ctx_buffer
for passing arguments.program->ctx_buffer + 8
for passing extra arguments.program->ctx_buffer
for passing return values.This make the logic simpler and less nested.
And hopefully we can unify
Args
andEarg
buffer for further better compatibility on low-end OpenGL 'implementations'.Describe the solution you'd like (if any)
As described above.
Additional comments
@k-ye Could you let people know your complete plan? Am I guessing right above?
What make me hate
Context
most is:It is placed in
taichi/runtime/llvm/context.h
, however every backend use it 🤣 We can makeContext
to be LLVM backend specific after this.The text was updated successfully, but these errors were encountered: