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

BUG: add option to choose host memory #75

Merged
merged 7 commits into from
Jan 29, 2024

Conversation

Jeanneclre
Copy link
Contributor

Hello @allemangD

I did some changes we discussed in the issue #66.
To resume them:

  1. Changed this
    val_outputs = sliding_window_inference(input_img, cropSize, args["nbr_GPU_worker"], net,overlap=args["precision"])

with this:

DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
val_outputs = sliding_window_inference(input_img, cropSize, args["nbr_GPU_worker"], net,
                                       overlap=args["precision"], sw_device= DEVICE, device=device_memory)                                                 
  1. Added a checkbox on the User Interface of Amass to enable "CPU memory"
  2. Error message in the shell asking user to try to enable CPU as a memory host (couldn't do a pop-up window from the CLI)

Output test:
On a machine equipped with an Intel Xeon Gold 6226R CPU running at 2.90GHz, with 62GB of memory and an NVIDIA RTX A6000 48GB, a CBCT scan with an approximate resolution of 0.3mm, covering the maxilla, mandible, skin, and cranial base, was segmented in 126.25 seconds.

Thank you!

@tschreiner
Copy link

Cuda fix looks good imho

@allemangD
Copy link
Contributor

allemangD commented Jan 16, 2024

Generally the changes look good. I don't think the phrasing of the UI is understandable, though, "CPU usage - check to enable" to me reads as it would execute segmentation on the GPU, I think it may confuse users.

I'd change to something like "Use CPU memory" with a tooltip "Use host memory with a performance penalty. Enable if CUDA runs out of memory." so a user could more easily find it after seeing an error about memory usage.

@Jeanneclre
Copy link
Contributor Author

Thank you for the feedback!
I've made the changes. Please let me know if you have any other suggestions. :)

@Jeanneclre
Copy link
Contributor Author

Hi @allemangD
I added a function to install the required libraries and their version for AMASS.
Should we change the PR title?

Thank you

Copy link
Contributor

@allemangD allemangD left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! I'll merge now.

@allemangD allemangD merged commit cf645b5 into DCBIA-OrthoLab:main Jan 29, 2024
@Jeanneclre Jeanneclre deleted the AMASS_changes branch January 30, 2024 00:56
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