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

[SageMaker] Pipeline execution overrides user-defined SageMaker configuration when running locally #1213

Open
thvasilo opened this issue Mar 12, 2025 · 0 comments
Labels
Milestone

Comments

@thvasilo
Copy link
Contributor

SageMaker local execution allows users to configure the Docker containers using a local file under $HOME/.sagemaker/config.yaml. See https://aws.amazon.com/blogs/machine-learning/configure-and-use-defaults-for-amazon-sagemaker-resources-with-the-sagemaker-python-sdk/ for details

An example file can be:

local:
    local_code: true # Using everything locally
    region_name: "us-east-1" # Name of the region
    container_config: # Additional docker container config
        shm_size: "58G"
        environment:
          - AWS_REGION: "us-east-1"

when creating a local session this configuration is saved as a dict in a config parameter:

from sagemaker.workflow.pipeline_context import LocalPipelineSession

local_session = LocalPipelineSession()
config_dict = local_session.config

However in execute_pipeline.py we override this config to set the shm size for the container:

local_session = LocalPipelineSession()
pipeline_generator = GraphStormPipelineGenerator(
pipeline_deploy_args, input_session=local_session
)
# Set shared memory to half of the host's size, as SM does
instance_mem_mb = int(psutil.virtual_memory().total // (1024 * 1024))
local_session.config = {
"local": {"container_config": {"shm_size": f"{instance_mem_mb//2}M"}}
}

What we should be doing instead is only update the shm_size if it's not already configured.

@thvasilo thvasilo added this to the 0.5.0 release milestone Mar 12, 2025
@thvasilo thvasilo added 0.5 good first issue Good for newcomers labels Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant