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

Late initialization of torch_gpu_device in pytorch plugin #2411

Merged
merged 3 commits into from
Oct 28, 2020
Merged

Late initialization of torch_gpu_device in pytorch plugin #2411

merged 3 commits into from
Oct 28, 2020

Conversation

mchalecki
Copy link
Contributor

Allows to run pytorch plugin DALIGenericIterator on systems without gpu.

Why we need this PR?

Pick one, remove the rest

  • It fixes a bug where pytorch plugin couldn't work on systems without gpu. It tried to find cuda device and failed.

What happened in this PR?

Fill relevant points, put NA otherwise. Replace anything inside []

  • What solution was applied:
    Late initialization of torch_gpu_device variable, only when it is first needed.
  • Affected modules and functionalities:
    Pytorch plugin
  • Key points relevant for the review:
    NA
  • Validation and testing:
    NA
  • Documentation (including examples):
    NA

JIRA TASK: [Use DALI-XXXX or NA]

@JanuszL
Copy link
Contributor

JanuszL commented Oct 28, 2020

Thank you for your valuable contribution.
Can you add a test for this case in test_dali_cpu_only.py, and you need to add torch to this test here.

@mchalecki
Copy link
Contributor Author

Added test and dependency as you suggested.

@JanuszL
Copy link
Contributor

JanuszL commented Oct 28, 2020

One key think seems to be missing. Please fix it and I will put it through our CI.

Co-authored-by: Janusz Lisiecki <39967756+JanuszL@users.noreply.github.com>
@JanuszL
Copy link
Contributor

JanuszL commented Oct 28, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1741036]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1741036]: BUILD PASSED

@JanuszL JanuszL merged this pull request into NVIDIA:master Oct 28, 2020
JanuszL pushed a commit that referenced this pull request Oct 28, 2020
* Late initialization of torch_gpu_device in pytorch plugin

Authored-by: Marcin Chalecki <marcin.chalecki@tcl.com>
@JanuszL
Copy link
Contributor

JanuszL commented Oct 28, 2020

@mchalecki - thank you for your contribution.

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.

4 participants