Skip to content
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

Install onnxruntime-gpu for non-Darwin platform #16

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

wkentaro
Copy link
Owner

So that it can accelerate with CUDA when possible.

cc @knorth55

@wkentaro wkentaro self-assigned this Feb 12, 2024
@wkentaro wkentaro added the other for pr label Feb 12, 2024
@wkentaro wkentaro merged commit 5c4f9a4 into main Feb 12, 2024
3 checks passed
@wkentaro wkentaro deleted the install_onnxruntime_gpu_for_non_darwin_platform branch February 12, 2024 14:15
@knorth55
Copy link

I confirmed that this is working as I expected.

CPU

$ python spam.py
2024-02-12 10:02:09.302 | INFO     | osam._models._base:__init__:91 - Initialized inference sessions with providers ['CPUExecutionProvider']
2024-02-12 10:02:09.302 | WARNING  | osam.apis:generate:31 - Prompt is not given, so using the center point as prompt: Prompt(points=array([[960., 720.]], dtype=float32), point_labels=array([1], dtype=int32))
Duration: 3.131537675857544
2024-02-12 10:02:11.647 | WARNING  | osam.apis:generate:31 - Prompt is not given, so using the center point as prompt: Prompt(points=array([[960., 720.]], dtype=float32), point_labels=array([1], dtype=int32))
Duration: 2.272653341293335

CUDA

$ python spam.py
2024-02-12 10:02:26.820 | INFO     | osam._models._base:__init__:91 - Initialized inference sessions with providers ['CUDAExecutionProvider', 'CPUExecutionProvider']
2024-02-12 10:02:26.821 | WARNING  | osam.apis:generate:31 - Prompt is not given, so using the center point as prompt: Prompt(points=array([[960., 720.]], dtype=float32), point_labels=array([1], dtype=int32))
Duration: 2.08842396736145
2024-02-12 10:02:28.011 | WARNING  | osam.apis:generate:31 - Prompt is not given, so using the center point as prompt: Prompt(points=array([[960., 720.]], dtype=float32), point_labels=array([1], dtype=int32))
Duration: 0.40121889114379883

@wkentaro
Copy link
Owner Author

wkentaro commented Feb 13, 2024

Thanks for checking @knorth55

FYI, I added benchmark.py in examples folder:
https://github.com/wkentaro/osam/blob/main/examples/benchmark/benchmark.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other for pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants