You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/04/26 13:29:54 UTC

[GitHub] [tvm] tqchen commented on pull request #11126: [PY] refactoring - move devices-related functions from tvm.runtime.ndarray

tqchen commented on PR #11126:
URL: https://github.com/apache/tvm/pull/11126#issuecomment-1109800104

   Thanks @pfk-beta , the original rationale was that device is closely coupled with ndarray itself(as ndarray is the only places that device get allocated). 
   
   Re-exposing the devices under tvm.runtime namespace would indeed be a readability improvement. From UX's pov we intentionally expose tvm.cpu/tvm.cuda not for internal development but for users, so we would like to keep those exposures to avoid API breaking.
   
   For the same reason(although weaker as there are less usages here), we would like to keep `nd.device` usages when possible. Personally i think putting devices definition as separate file or in ndarray do not have a big difference, although in this case it does bring a minor readability gain. 
   
   One simple approach is to re-expose nd.cpu etc in the runtime namespace, and use runtime.device in most of the places you mention.  This would be the least surgical change while retains the readability part.
   
   
   
   
   


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