-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Model repack always uploads data to S3 bucket regardless of local mode settings #3031
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
Comments
This is more a question of behavior than a bug; by specifying an S3 URI for One case against changing this behavior is it means the SDK would be transparently changing the parameters you're passing to the model. Users will see an S3 location in I'll leave it up to the team as to whether they want to change this behavior or not |
Thanks, @staubhp, for a quick response! I have used |
Interesting. That would be a bug then; I'd expect all repacking to happen locally when you start with a file:// |
Fix released. Should be fixed in release >= v2.89.0 |
Describe the bug
sagemaker.model.Model
uploads data to S3 when repacking, regardless and despite of local mode settings.Why is this important?
1/ It seems to contradict the intention of using
local_code
setting to disallow S3 uploads of code-, model-, and other artifacts to S3.2/ Imagine using Local Mode for dev purposes and having a moderate-sized model (say ResNet-50, with 170mb in serialization). Without proper implementation of
local_code=True
scenario, every launch in LOCAL MODE will trigger an (unnecessary) upload to S3 due torepack()
-call and then an immediate download to the locally-run container due toSM_SUBMIT_DIRECTORY = s3://...
. This round trip can causes minutes of delay. Instead of this, the local (repacked) directory with model- and code-artifacts should be mounted directly to the container as/opt/ml/model
.To reproduce
Expected behavior
Expected behaviour is that with these local mode settings, the model and inference scripts are repacked and stored locally (as
file://...
) and not uploaded to S3, as is currently implemented for cases when no repacking is needed.Advices to fix
sagemaker.model.Model
implements_upload_code()
, which (in case if repack is needed) defines the following repacked model data pathirrespective of the LOCAL MODE settings (contradicting the logic for when no repack is needed). Perhaps, what we need to do is introduce a check for LOCAL MODE that will conditionally define the
repacked_model_data
either havings3://
(non-LOCAL) orfile://
(LOCAL) paths prefixes. This will (probably) be enough to fix this, as theutils.repack_model(repacked_model_uri=repacked_model_data, ...)
checks the prefix of the providedrepacked_model_uri
to decide whether to upload data to S3, or store locally.System information
A description of your system. Please provide:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: