Skip to content

XGBoost estimator, security_group_ids parameter doesn't work. #2107

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

Closed
demetribu opened this issue Jan 24, 2021 · 5 comments · Fixed by #4269
Closed

XGBoost estimator, security_group_ids parameter doesn't work. #2107

demetribu opened this issue Jan 24, 2021 · 5 comments · Fixed by #4269

Comments

@demetribu
Copy link

Describe the bug
I'm trying to submit a job from a local environment to Sagemaker in script mode, with custom VPC. I'm using "sagemaker.xgboost.estimator.XGBoost" and security_group_ids parameter. Job is submitted successfully, but without any changes regarding VPC, also I did notice non-errors in a log.

To reproduce

from sagemaker.session import Session
from sagemaker.inputs import TrainingInput
from sagemaker.xgboost.estimator import XGBoost
import boto3

boto_session = boto3.Session()
session = Session(boto_session=boto_session)

entry_point=""
source_dir="src.tar.gz"
role=""
instance_type=""
framework_version="1.0-1"
instance_count=None
security_group_ids=[""]

xgb_estimator = XGBoost(
    entry_point=entry_point,
    source_dir=source_dir,
    role=role,
    security_group_ids=security_group_ids,
    instance_count=instance_count,
    instance_type=instance_type,
    framework_version=framework_version
)

xgb_estimator.fit()

Expected behavior
There are non-errors, also as non-changes regarding VPC.
No custom VPC settings applied.

@ahsan-z-khan
Copy link
Member

@dmitrybugakov Thank you for using Amazon SageMaker.

Which python version do you see the bug on?

@demetribu
Copy link
Author

@ahsan-z-khan

python==3.8.6
boto3==1.16.59
sagemaker==2.24.0

@ChoiByungWook
Copy link
Contributor

Hey @dmitrybugakov,

Apologies on the late response.

In order to use custom security groups, you will need to also provide corresponding subnets.

The Python SDK determines this during fit in this line:

vpc_config = estimator.get_vpc_config()

Which ends up calling:

return vpc_utils.to_dict(self.subnets, self.security_group_ids)
and runs into this conditional:
def to_dict(subnets, security_group_ids):

This is not a nice user experience, as it should fail if the user provides one of the two required inputs.

I have made note of this issue on our end.

@demetribu
Copy link
Author

@ChoiByungWook thank you!
In case, I will have free time, and the issue will still exist, I'm going to fix that.

@pbendevis
Copy link

I am seeing that the subnet and security groups do not appear in the console (even when both are set using the xgboost estimator client). Seems like there not being forwarded. If I set them manually in the console I don't get errors so I don't think it is due silent failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants