You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "jinhongyii (via GitHub)" <gi...@apache.org> on 2023/02/26 04:11:58 UTC
[GitHub] [tvm] jinhongyii opened a new pull request, #14132: [Unity] Add Global info
jinhongyii opened a new pull request, #14132:
URL: https://github.com/apache/tvm/pull/14132
As we start to build more structure into the program, there is an increasing need to incorporate globally static object that are referred by the IR itself. So we introduce "GlobalInfo" here to represent these objects. Below is an example of a possible representation of a distributed program with global info. Pay attention to "mesh", which represents the global infos in the module. It contains a list of two device meshes , and they are accessed using syntax like "mesh[0]", which is a sugar for IRModule.global_infos["mesh"][0]
```
@I.ir_module
class TestModule:
I.module_attrs({"device_num": 10})
I.module_global_infos(
{
"mesh": [
R.device_mesh((2, 2), R.range(0, 4)), # mesh[0]
R.device_mesh((1,), R.range(4, 5)), # mesh[1]
]
}
)
@T.prim_func
def tir_func(
x: T.Buffer((T.int64(128), T.int64(128)), "float32"),
y: T.Buffer((T.int64(128), T.int64(128)), "float32"),
):
T.func_attr({"tir.noalias": True})
for i, j in T.grid(T.int64(128), T.int64(128)):
with T.block():
vi, vj = T.axis.remap("SS", [i, j])
y[vi, vj] = x[vi, vj] + 1.0
@R.function
def foo(
x: R.DTensor((128, 128), "float32", device_mesh="mesh[0]", placement="S[0], R"),
) -> R.DTensor((128, 128), "float32", device_mesh="mesh[0]", placement="S[0], R"):
gv0 = R.dist.call_tir(
tir_func,
x,
R.DTensor(
shape=(128, 128), dtype="float32", device_mesh="mesh[0]", placement="S[0], R"
),
)
return gv0
```
To summarize the PR, it
1. add a base class GlobalInfo
2. add a global_infos: Map[str, List[GlobalInfo]] field in IRModule
3. support parsing/printing for I.module_attrs and I.module_global_infos.\
cc: @tqchen, @junrushao
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tqchen merged pull request #14132: [Unity] Add Global info
Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #14132:
URL: https://github.com/apache/tvm/pull/14132
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] tvm-bot commented on pull request #14132: [Unity] Add Global info
Posted by "tvm-bot (via GitHub)" <gi...@apache.org>.
tvm-bot commented on PR #14132:
URL: https://github.com/apache/tvm/pull/14132#issuecomment-1445264273
<!---bot-comment-->
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @-ing them in a comment.
<!--bot-comment-ccs-start-->
* cc @quic-sanirudh <sub>See [#10317](https://github.com/apache/tvm/issues/10317) for details</sub><!--bot-comment-ccs-end-->
<sub>Generated by [tvm-bot](https://github.com/apache/tvm/blob/main/ci/README.md#github-actions)</sub>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] yongwww commented on pull request #14132: [Unity] Add Global info
Posted by "yongwww (via GitHub)" <gi...@apache.org>.
yongwww commented on PR #14132:
URL: https://github.com/apache/tvm/pull/14132#issuecomment-1451090199
Hi @jinhongyii thanks for the work! I have a follow-up question, looks the global info here is very similar to metadata section, is there any difference? I am wondering if we can merge them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [tvm] jinhongyii commented on pull request #14132: [Unity] Add Global info
Posted by "jinhongyii (via GitHub)" <gi...@apache.org>.
jinhongyii commented on PR #14132:
URL: https://github.com/apache/tvm/pull/14132#issuecomment-1451134499
Meta data are used to store ObjectRef fragment in the IR that are not printable. However, global infos should be printable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org