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

improv(package): use python slim base image and let pytorch install cuda #807

Merged
merged 1 commit into from Jan 12, 2024

Conversation

larme
Copy link
Member

@larme larme commented Dec 22, 2023

We can let pytorch install it's own cuda runtime and save some duplicate spaces

@larme larme requested a review from aarnphm as a code owner December 22, 2023 03:02
@aarnphm
Copy link
Member

aarnphm commented Dec 22, 2023

I think the reason why we set the base image to use cuda is that all bento will be idempotent.

It won't depend on machine host cuda version. Therefore, a drawback is that we will have to download the binary twice.

@larme
Copy link
Member Author

larme commented Dec 22, 2023

I think the reason why we set the base image to use cuda is that all bento will be idempotent.

It won't depend on machine host cuda version. Therefore, a drawback is that we will have to download the binary twice.

It won't depend on machine host cuda version because pytorch will download cuda runtime version that suitable to this pytorch version.

Host's cuda version is just cuda driver version, which is compatible with higher cuda runtime version, which is installed inside the docker container by pytorch. So we are not depending on host's cuda version in most case

@aarnphm
Copy link
Member

aarnphm commented Dec 22, 2023

I think the reason why we set the base image to use cuda is that all bento will be idempotent.
It won't depend on machine host cuda version. Therefore, a drawback is that we will have to download the binary twice.

It won't depend on machine host cuda version because pytorch will download cuda runtime version that suitable to this pytorch version.

Host's cuda version is just cuda driver version, which is compatible with higher cuda runtime version, which is installed inside the docker container by pytorch. So we are not depending on host's cuda version in most case

This is not true, because pytorch will still pick up host machine cuda nonetheless. So if the container doesn't have a cuda, and host machine has older cuda, then it won't work.

We have seen this on bentocloud b4. Hence, this is the current fix.

@larme
Copy link
Member Author

larme commented Dec 22, 2023

We have seen this on bentocloud b4. Hence, this is the current fix.

Was this the test done with xipeng? I think we (xipeng, jiangbo and me) have verified that pytorch will install cuda regardless if host cuda is available. @yetone could you confirm?

@aarnphm
Copy link
Member

aarnphm commented Dec 22, 2023

We have seen this on bentocloud b4. Hence, this is the current fix.

Was this the test done with xipeng? I think we (xipeng, jiangbo and me) have verified that pytorch will install cuda regardless if host cuda is available. @yetone could you confirm?

Yes we decided that we still set cuda as base image so that the future update won't break old bento.

@aarnphm aarnphm merged commit 8baaf12 into bentoml:main Jan 12, 2024
24 checks passed
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.

None yet

2 participants