JumpStartModel corrupts environment variables (incorrect snake_case conversion) when using a private hub
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- aws, python
- Área
- cloud, machine-learning
Línea de trabajo
Comienza en JumpStartInstanceTypeVariants.from_describe_hub_content_response y sigue su llamada a walk_and_apply_json(response, camel_to_snake). Compara esta ruta del hub con el comportamiento de public-hub en from_json y reprodúcela después con JumpStartModel.prepare_container_def usando un hub privado. Se considera completado cuando las claves como SM_VLLM_MAX_MODEL_LEN permanecen sin cambios y los valores específicos de la instancia sobrescriben los valores predeterminados base.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
PySDK Version
- PySDK V2 (2.x)
- PySDK V3 (3.x)
Describe the bug
When using the JumpStartModel class to deploy a model reference hosted on a private hub (by passing the hub_name parameter), a subset of the container environment variable names arrive corrupted. The variable names from the instance-specific overrides are recursively converted from UpperCamelCase to snake_case. The SDK uses a regular expression that inserts an underscore before every capital letter and then lowercases the result.
As a result, a variable like SM_VLLM_MAX_MODEL_LEN becomes s_m__v_l_l_m__m_a_x__m_o_d_e_l__l_e_n. This causes the instance-specific override to silently fail and not merge over the base defaults, as the spelling collision is broken. The defect is located in the hub deserialization path (JumpStartInstanceTypeVariants.from_describe_hub_content_response), which applies a walk_and_apply_json(response, camel_to_snake) function across the entire document structure.
To reproduce
from sagemaker.jumpstart.model import JumpStartModel
# Note: Requires a private hub setup with a ModelReference to a JumpStart model
model = JumpStartModel(
model_id="huggingface-vlm-gemma-4-e4b-it",
model_version="*",
config_name="generate_lowest_cost",
hub_name="mi-hub-jumpstart-2", # Replace with your private hub name
region="eu-south-2",
)
# Inspect the container definition before creating the model
container_def = model.prepare_container_def(
accept_eula=True
)
# Check the environment variables
print(container_def["Environment"])
The environment variables will already show up as corrupted when executing this method.
Expected behavior
The environment variables from instance-specific overrides (located under HostingInstanceTypeVariants) should retain their original names (e.g., SM_VLLM_MAX_MODEL_LEN). The values from these instance-specific overrides should properly override the base defaults without having their keys modified into snake_case with underscores during JSON parsing.
Screenshots or logs
Example of the corrupted environment block showing duplicated values:
SM_VLLM_MAX_MODEL_LEN = 4096
s_m__v_l_l_m__m_a_x__m_o_d_e_l__l_e_n = 131072
h_f__h_u_b__o_f_f_l_i_n_e = 1
System information
-
SageMaker Python SDK version: 2.245.0 (Defect confirmed by AWS Support to also be present in recent versions 2.257.6 and 3.20.0)
-
Framework name (eg. PyTorch) or algorithm (eg. KMeans): JumpStart
-
Framework version: N/A
-
Python version: Python 3
-
CPU or GPU: Any
-
Custom Docker image (Y/N): N
Additional context
AWS Premium Support investigated this under Case ID 178704468000307. They confirmed that the equivalent public-hub function, from_json, performs no key conversion at all, which is why the exact same model deploys correctly when taken from the public catalog. The issue occurs specifically because the names in HostingInstanceTypeVariants are defined as keys in a map, and are thus incorrectly caught by the camel_to_snake recursive rewrite during hub deserialization.
- Lenguaje dominante
- Python
- Estrellas
- 2.3k
- Forks
- 1.3k
- Merge medio
- 3 d 9 h
- PR fusionados (30 d)
- 42
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/sagemaker-python-sdk
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
aws/sagemaker-python-sdk#6278 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws/sagemaker-python-sdk#6253 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 93/100
aws/sagemaker-python-sdk#6232 ·
-
component: model monitor type: bug
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
aws/sagemaker-python-sdk#6206 ·
-
component: model builder type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
aws/sagemaker-python-sdk#6199 ·
Todos los issues de aws/sagemaker-python-sdk
Issues similares
-
triage/confirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
apache/cloudstack#14222 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100