sagemaker.train.common#

Classes

CustomizationTechnique(value)

Customization techniques for fine-tuning.

FineTuningOptions(options_dict[, ...])

Dynamic class for fine-tuning options with validation.

TrainingType(value)

Training types for fine-tuning.

class sagemaker.train.common.CustomizationTechnique(value)[source]#

Bases: Enum

Customization techniques for fine-tuning.

CPT = 'CPT'#
DPO = 'DPO'#
RLAIF = 'RLAIF'#
RLVR = 'RLVR'#
SFT = 'SFT'#
class sagemaker.train.common.FineTuningOptions(options_dict: Dict[str, Any], sequence_length: int | None = None)[source]#

Bases: object

Dynamic class for fine-tuning options with validation.

get_info(param_name: str = None)[source]#

Display parameter information in a user-friendly format.

to_dict() Dict[str, Any][source]#

Convert back to dictionary for hyperparameters with string values.

to_user_dict() Dict[str, Any][source]#

Return only user-explicitly-set hyperparameters as string key-value pairs.

validate_length_constraints()[source]#

Enforce that selected lengths fit the recipe’s sequence_length.

For RL recipes: max_prompt_length + max_response_length must not exceed sequence_length. For SFT/DPO: the single-example length (dataset_max_len) must not exceed it. Per-field min/max are already enforced on assignment; this adds the cross-field sum check that a per-field max cannot express.

Framework-agnostic: gated only on the recipe’s sequence_length metadata, not on the model family. No-op if sequence_length is unknown or the relevant params are absent.

class sagemaker.train.common.TrainingType(value)[source]#

Bases: Enum

Training types for fine-tuning.

FULL = 'FULL'#
LORA = 'LORA'#