Skip to content

fix(train): omit input_data_config when no input channels are provided - #6399

Open
reginaldalfret wants to merge 1 commit into
aws:masterfrom
reginaldalfret:fix/issue-6156-omit-empty-input-data-config
Open

reginaldalfret wants to merge 1 commit into
aws:masterfrom
reginaldalfret:fix/issue-6156-omit-empty-input-data-config

Conversation

@reginaldalfret

Copy link
Copy Markdown

Description

When a ModelTrainer is configured without input channels (such as fine-tuning jobs where data is fetched directly inside the container from Hugging Face Hub or other sources), _create_training_job_args previously emitted "input_data_config": [].

SageMaker's CreatePipeline rejects an empty array with:

ValidationException: Unable to parse pipeline definition. Model Validation failed: Length of container InputDataConfig=0 cannot be less than min=1.

While SageMaker's API accepts an omitted InputDataConfig, it rejects an empty list due to the min=1 constraint in the service model. Under PySDK v2, the key was omitted when no channels were provided.

Solution

  • Omit input_data_config from the generated training request dictionary when final_input_data_config is empty.
  • Access training_request.get("input_data_config") safely in _LocalContainer instantiation.
  • Added unit tests verifying input_data_config is omitted when empty and included when channels are provided.

Fixes #6156

When a ModelTrainer has no input channels specified, _create_training_job_args
serialized an empty list ('input_data_config: []'). Downstream CreatePipeline
rejects an empty InputDataConfig array with ValidationException because the
botocore service model enforces min=1 on InputDataConfig when present.

Omit input_data_config from training_request when final_input_data_config is
empty, allowing the SageMaker API and CreatePipeline to succeed as in v2.

Fixes aws#6156

Signed-off-by: reginaldalfret <reginaldalfret@gmail.com>

This branch had an error being deployed

1 failed deployment
manual-approval — dbda3de2 Deployed Oct 9, 2026 by reginaldalfret via wait-for-approval #575
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.

[Bug] ModelTrainer with no input channels emits InputDataConfig: [], which CreatePipeline rejects (min=1) — v2 omitted the key

1 participant