You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "Lunderberg (via GitHub)" <gi...@apache.org> on 2024/02/21 17:33:02 UTC

[PR] [Disco] Propagate structlog configuration to disco workers [tvm]

Lunderberg opened a new pull request, #16618:
URL: https://github.com/apache/tvm/pull/16618

   Prior to this commit, `structlog.configure(...)` would only impact log statements generated in the main process, while workers started with `disco.session.ProcessSession` would not inherit the `structlog` configuration.  While `disco.session.ThreadedSession` would inherit the `structlog` configuration, it would also inherit process-specific CUDA variables.
   
   This commit updates `disco.session.ProcessSession` to explicitly propagate any `structlog` configuration to child processes.  This implementation intentionally avoids introducing a new dependency for TVM.  If the `structlog` package is not available, the config propagation is skipped.


-- 
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


Re: [PR] [Disco] Propagate structlog configuration to disco workers [tvm]

Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on code in PR #16618:
URL: https://github.com/apache/tvm/pull/16618#discussion_r1500782538


##########
python/tvm/runtime/__init__.py:
##########
@@ -40,3 +40,4 @@
 )
 
 from . import executor
+from . import disco

Review Comment:
   Looks like disco is enabled by default, and is always included in `libtvm_runtime.so` ([`CMakeLists.txt` link](https://github.com/apache/tvm/blob/main/CMakeLists.txt#L367).  As a result, it should always be safe to import `tvm.runtime.disco`.
   
   If we later add a cmake flag to disable disco, we should be able to gate this import behind a check on `tvm.support.libinfo()[cmake_flag]`.



-- 
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


Re: [PR] [Disco] Propagate structlog configuration to disco workers [tvm]

Posted by "Lunderberg (via GitHub)" <gi...@apache.org>.
Lunderberg commented on code in PR #16618:
URL: https://github.com/apache/tvm/pull/16618#discussion_r1500776496


##########
python/tvm/runtime/__init__.py:
##########
@@ -40,3 +40,4 @@
 )
 
 from . import executor
+from . import disco

Review Comment:
   Hmm, good point.  The `tvm._ffi.register_object("runtime.disco.*")` calls would raise an error if disco isn't available.
   
   This was primarily to ensure that all packaged funcs generated by `tvm.runtime.disco` were available within the disco sub-process.  I'll try a build without disco enabled, and see what is required to make sure that the module import works either way.



-- 
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


Re: [PR] [Disco] Propagate structlog configuration to disco workers [tvm]

Posted by "Hzfengsy (via GitHub)" <gi...@apache.org>.
Hzfengsy commented on code in PR #16618:
URL: https://github.com/apache/tvm/pull/16618#discussion_r1500565269


##########
python/tvm/runtime/__init__.py:
##########
@@ -40,3 +40,4 @@
 )
 
 from . import executor
+from . import disco

Review Comment:
   Not sure if it's safe when runtime is not compiled with disco.



-- 
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


Re: [PR] [Disco] Propagate structlog configuration to disco workers [tvm]

Posted by "masahi (via GitHub)" <gi...@apache.org>.
masahi merged PR #16618:
URL: https://github.com/apache/tvm/pull/16618


-- 
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