cursus.steps.configs.config_xgboost_mt_training_step

XgboostMt Training Step Configuration

This module implements the configuration class for SageMaker XgboostMt Training steps using custom Docker image with multi-task learning capabilities. Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private with properties)

class XgboostMtTrainingConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost_mt', current_date=<factory>, framework_version='2.1.2', py_version='py310', source_dir=None, enable_caching=False, use_secure_pypi=True, max_runtime_seconds=172800, project_root_folder, training_entry_point, training_instance_type='ml.m5.4xlarge', training_instance_count=1, training_volume_size=30, ca_repository_arn='arn:aws:codeartifact:us-west-2:149122183214:repository/amazon/secure-pypi', max_run_seconds=86400, skip_hyperparameters_s3_uri=True, use_precomputed_imputation=False, use_precomputed_risk_tables=False, use_precomputed_features=False, use_native_categorical=True, job_type=None, **extra_data)[source]

Bases: BasePipelineConfig

Configuration specific to the SageMaker XgboostMt Training Step.

Uses custom XgboostMt Docker image for multi-task learning with: - Shared tree structures across related tasks - Adaptive task weighting based on similarity (JS divergence) - Knowledge distillation for performance stabilization - Refactored loss functions and model architecture

Hyperparameters are managed separately via XGBoostMtModelHyperparameters and saved as hyperparameters.json in the source_dir.

Fields are organized into three tiers: 1. Tier 1: Essential User Inputs - fields that users must explicitly provide 2. Tier 2: System Inputs with Defaults - fields with reasonable defaults that can be overridden 3. Tier 3: Derived Fields - fields calculated from other fields (private with properties)

training_entry_point: str
training_instance_type: str
training_instance_count: int
training_volume_size: int
framework_version: str
py_version: str
ca_repository_arn: str
model_class: str
max_run_seconds: int
skip_hyperparameters_s3_uri: bool
use_secure_pypi: bool
use_precomputed_imputation: bool
use_precomputed_risk_tables: bool
use_precomputed_features: bool
use_native_categorical: bool
job_type: str | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property hyperparameter_file: str

Get hyperparameter file path.

model_dump(**kwargs)[source]

Override model_dump to include derived properties.

classmethod validate_job_type(v)[source]

Validate job_type is open (any lowercase alphanumeric with underscores; None = standard).

initialize_derived_fields()[source]

Initialize all derived fields once after validation.

get_environment_variables()[source]

Get environment variables for the XgboostMt training script.

Returns:

Dictionary mapping environment variable names to values

Return type:

Dict[str, str]

classmethod validate_xgboost_mt_instance_type(v)[source]

Validate instance types suitable for XgboostMt.

XGBoost works efficiently on CPU instances, especially for multi-task learning where memory and compute balance is important.

get_public_init_fields()[source]

Override get_public_init_fields to include XgboostMt training-specific fields. Gets a dictionary of public fields suitable for initializing a child config. Includes both base fields (from parent) and XgboostMt training-specific fields.

Returns:

Dictionary of field names to values for child initialization

Return type:

Dict[str, Any]

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.