You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modern packages use optional dependecies / extras for specific functionality. I assume this is very well possible for the sagemaker sdk.
A similar request was posted in discussions: #5441
I couldn't find any actual "issue" and hope this gets more visibility.
The main and most urgent topic is the dependency of pytorch which requires 354/620mb size in a clean venv. I would assume that most use cases don't need pytorch at all.
The packages sagemaker-{train,serve,mlops} are mentioned in the optional dependencies extras, but also added as non-optional dependencies in pyproject.toml
I'm not sure if the code was designed to handle optional dependencies or not, but pulling torch, cuda and the kitchen sink to use the SageMaker API is not ideal.
[edit]: Depending on sagemaker-mlops instead of sagemaker-sdk also does not help much, since -mlops depends on -train, which then brings torch, cuda, etc.
This seems to be fixed now in the latest version of the sagemaker-core package. But if you install sagemaker or sagemaker-{mlops,serve} the same issue arises as is a core dependency in the sagemaker-serve package, could this one also be optional?
(Duplicated from issue 5457, but I wasn't sure in which one to comment)
Disappointed to see no movement on (or even acknowledgment of) this issue for months. Not sure who to tag--@aviruthen? @mohamedzeidan2021? Can we merge @goelakash's PR?
Activity
kassick commentedon Feb 11, 2026
The packages
sagemaker-{train,serve,mlops}are mentioned in the optional dependencies extras, but also added as non-optional dependencies in pyproject.tomlThis change was introduced in 869f3ee
I'm not sure if the code was designed to handle optional dependencies or not, but pulling torch, cuda and the kitchen sink to use the SageMaker API is not ideal.
[edit]: Depending on
sagemaker-mlopsinstead ofsagemaker-sdkalso does not help much, since-mlopsdepends on-train, which then brings torch, cuda, etc.matteociccozzi-ah commentedon Apr 14, 2026
Surprising this issue has been open for so long with no attention. Looking at the code doesn't seem like torch it actually needed in sagemaker-core.
aW3st commentedon May 26, 2026
This is blocking us from upgrading to Sagemaker 3. Would love an update from the maintainers.
JoseJuan98 commentedon Jun 1, 2026
This seems to be fixed now in the latest version of the
sagemaker-corepackage. But if you installsagemakerorsagemaker-{mlops,serve}the same issue arises as is a core dependency in thesagemaker-servepackage, could this one also be optional?(Duplicated from issue 5457, but I wasn't sure in which one to comment)
fix(serve): make torch an optional dependency
goelakash commentedon Aug 7, 2026
Opened a PR to address this #6166
fix(serve): make torch an optional dependency
aW3st commentedon Oct 22, 2026
Disappointed to see no movement on (or even acknowledgment of) this issue for months. Not sure who to tag--@aviruthen? @mohamedzeidan2021? Can we merge @goelakash's PR?
fix: close the remaining gaps in optional torch support
mohamedzeidan2021 commentedon Oct 23, 2026
Hi @aW3st, I apologize for the delay. Thank you for pinging again. We will prioritize and try to release a fix ASAP.
fix: close the remaining gaps in optional torch support (#6531)