dqm_ml_core.models.global_
Global configuration models for storage, compute, and error handling.
Defines shared configuration classes used across pipeline interfaces: - RetryConfig: Retry policies for storage operations - StorageConfig: S3/local storage with credential management - ComputeConfig: Runtime settings (device, memory, threads, logging) - ImageErrorsConfig/TabularErrorsConfig/ErrorsConfig: Error handling policies
ComputeConfig
Bases: BaseModel
Global compute / runtime settings.
Source code in packages/dqm-ml-core/src/dqm_ml_core/models/global_.py
device: Literal['auto', 'cpu', 'cuda'] = Field(default='auto', description="Compute device: 'auto' picks cuda if available.")
class-attribute
instance-attribute
log_level: Literal['debug', 'info', 'warning', 'error'] = Field(default='warning', description='Logging verbosity.')
class-attribute
instance-attribute
max_memory: str | None = Field(default=None, description="Maximum memory per worker (e.g. '4Gi').")
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
class-attribute
instance-attribute
progress_bar: bool = Field(default=True, description='Show tqdm progress bars.')
class-attribute
instance-attribute
seed: int = Field(default=42, description='Random seed for reproducibility.')
class-attribute
instance-attribute
threads: int = Field(default=4, gt=0, description='Number of worker threads.')
class-attribute
instance-attribute
ErrorsConfig
Bases: BaseModel
Aggregate error-handling configuration.
Source code in packages/dqm-ml-core/src/dqm_ml_core/models/global_.py
default: Literal['silent_fail', 'fail_fast'] = Field(default='silent_fail', description='Default error action when no specific policy is set.')
class-attribute
instance-attribute
images: ImageErrorsConfig | None = None
class-attribute
instance-attribute
max_failure_rate: float = Field(default=0.05, ge=0, le=1, description='Maximum tolerated failure rate before the job aborts (from 0.0 to 1.0).')
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
class-attribute
instance-attribute
tabular: TabularErrorsConfig | None = None
class-attribute
instance-attribute
ImageErrorsConfig
Bases: BaseModel
Error-handling policy for image-processing failures.
Source code in packages/dqm-ml-core/src/dqm_ml_core/models/global_.py
model_config = ConfigDict(extra='forbid')
class-attribute
instance-attribute
on_decode_failure: Literal['silent_fail', 'fail_fast'] = Field(default='silent_fail', description='Action when an image cannot be decoded.')
class-attribute
instance-attribute
on_transform_error: Literal['silent_fail', 'fail_fast'] = Field(default='silent_fail', description='Action when an image transform fails.')
class-attribute
instance-attribute
on_unsupported_format: Literal['silent_fail', 'fail_fast'] = Field(default='fail_fast', description='Action on unsupported image format.')
class-attribute
instance-attribute
RetryConfig
Bases: BaseModel
Retry policy for storage operations.
Source code in packages/dqm-ml-core/src/dqm_ml_core/models/global_.py
max_attempts: int = Field(default=3, gt=0, description='Maximum number of retry attempts.')
class-attribute
instance-attribute
mode: Literal['default', 'standard'] = Field(default='standard', description="Retry mode: 'default' uses exponential backoff, 'standard' uses fixed intervals.")
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
class-attribute
instance-attribute
StorageConfig
Bases: BaseModel
Remote or local storage configuration.
Source code in packages/dqm-ml-core/src/dqm_ml_core/models/global_.py
access_key: str | None = Field(default=None, description='AWS access key ID.')
class-attribute
instance-attribute
anonymous: bool = Field(default=False, description='Use anonymous (unsigned) requests.')
class-attribute
instance-attribute
bucket: str | None = Field(default=None, description="S3 bucket name (required when type='s3').")
class-attribute
instance-attribute
checksum_validation: Literal['when_required', 'always', 'never'] = Field(default='when_required', description='Controls S3 checksum validation behaviour.')
class-attribute
instance-attribute
connect_timeout: float | None = Field(default=None, description='Connection timeout in seconds.')
class-attribute
instance-attribute
endpoint: str | None = Field(default=None, description='Custom S3 endpoint URL.')
class-attribute
instance-attribute
external_id: str | None = Field(default=None, description='External ID for role assumption.')
class-attribute
instance-attribute
load_frequency: int = Field(default=900, gt=0, description='Frequency (seconds) to refresh credentials / role.')
class-attribute
instance-attribute
model_config = ConfigDict(extra='forbid')
class-attribute
instance-attribute
proxy_options: dict[str, Any] | str | None = Field(default=None, description='Proxy configuration as a dict or URL string.')
class-attribute
instance-attribute
region: str | None = Field(default=None, description="AWS region (e.g. 'us-east-1').")
class-attribute
instance-attribute
request_timeout: float | None = Field(default=None, description='Request timeout in seconds.')
class-attribute
instance-attribute
retry: RetryConfig | None = None
class-attribute
instance-attribute
role_arn: str | None = Field(default=None, description='ARN of IAM role to assume.')
class-attribute
instance-attribute
scheme: str | None = Field(default=None, description="URI scheme (e.g. 'https').")
class-attribute
instance-attribute
secret_key: str | None = Field(default=None, description='AWS secret access key.')
class-attribute
instance-attribute
session_name: str | None = Field(default=None, description='Name for the assumed role session.')
class-attribute
instance-attribute
session_token: str | None = Field(default=None, description='AWS session token.')
class-attribute
instance-attribute
tls_ca_file_path: str | None = Field(default=None, description='Path to a custom TLS CA bundle.')
class-attribute
instance-attribute
type: Literal['s3', 'local'] = Field(description='Storage backend type.')
class-attribute
instance-attribute
TabularErrorsConfig
Bases: BaseModel
Error-handling policy for tabular-data failures.