Skip to content

[Target][Device] Auto detect target and create device from str in torch style#15714

Merged
junrushao merged 1 commit intoapache:mainfrom
LeshengJin:NN/feature/auto_device_target
Sep 13, 2023
Merged

[Target][Device] Auto detect target and create device from str in torch style#15714
junrushao merged 1 commit intoapache:mainfrom
LeshengJin:NN/feature/auto_device_target

Conversation

@LeshengJin
Copy link
Copy Markdown
Contributor

  • Target auto detection: Target.auto_detect().
  • Target created from device: Target.from_device("cuda") or Target.from_device(tvm.cuda())
  • create device from str: tvm.device("cuda:0") or tvm.device("cuda", 0)

@Hzfengsy
Copy link
Copy Markdown
Member

Hzfengsy commented Sep 9, 2023

I guess it should be a PR to main branch instead of unity

@LeshengJin LeshengJin changed the base branch from unity to main September 12, 2023 01:46
@LeshengJin LeshengJin force-pushed the NN/feature/auto_device_target branch from 9915b30 to 72a5e11 Compare September 12, 2023 04:14
@LeshengJin
Copy link
Copy Markdown
Contributor Author

I have rebased it to main. Thanks! @Hzfengsy

Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/detect_target.py
Comment thread python/tvm/target/target.py
Comment thread python/tvm/target/detect_target.py Outdated
Comment thread python/tvm/target/target.py Outdated
…ch style

- Target auto detection: `Target.auto_detect()`.
- Target created from device: `Target.from_device("cuda")` or
  `Target.from_device(tvm.cuda())`
- create device from str: `tvm.device("cuda:0")` or tvm.device("cuda",
  0)
@LeshengJin LeshengJin force-pushed the NN/feature/auto_device_target branch from 15112e2 to ca67e7b Compare September 13, 2023 05:20
Copy link
Copy Markdown
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this amazing contribution!

@junrushao junrushao merged commit d1ede36 into apache:main Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants