[server] unpickle-time recursion in starlette State / pydantic MockValSer; tinker request types fail pydantic validation (NameError LossFnInputs)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 22/100
Línea de trabajo
Start by tracing the server’s /api/v1/forward_backward request validation and the pickle deserialization path described in the report. Review the proposed server/_compat_pickle.py changes and verify how the Tinker dataclasses, LossFnInputs, and TensorData reach Pydantic; the issue reports no file or test path. Done means both reported failures are handled and the ForwardBackwardRequest protocol flow validates through optim_step.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Checklist / 检查清单
- I have searched existing issues, and this is a new bug report. / 我已经搜索过现有的 issues,确认这是一个新的 bug report。
Bug Description / Bug 描述
Tinker 兼容网关(server)在本环境两类必现故障:
-
cloudpickle 反序列化过程中,starlette State.getattr 与 pydantic
MockValSer.getattr 访问未填充的 slot(_state / _attempt_rebuild)→ 无限递归
/ "AttributeError: MockValSer unavailable (item='validate_python')"。 -
训练请求体校验 ForwardBackwardRequest 失败:"NameError: name 'LossFnInputs' is
not defined"。根因:tinker SDK 的请求类型是 stdlib dataclass 且 module 被改写
为 'tinker',pydantic 按 tinker 包 namespace 解析字符串注解,而该 namespace 缺
LossFnInputs / Optional / np 等名字;且 TensorData 含 np.ndarray 字段,pydantic
无法生成 core schema。
How to Reproduce / 如何复现
- 启动 twinkle server(qwen3.5 模型,lora train_mode),healthz 正常。
- POST /api/v1/forward_backward(Tinker 协议,ForwardBackwardRequest):
网关侧 pydantic 校验抛 NameError: name 'LossFnInputs' is not defined。 - 反序列化路径触发 State/MockValSer 自递归(AttributeError: MockValSer unavailable)。
期望:server 在 FastAPI body 校验前应用防护;或 tinker SDK 类型可被 pydantic 校验
(若认为属 tinker SDK 责任,建议 twinkle 侧文档说明需要的最小兼容层)。
Additional Information / 补充信息
- twinkle: dev-swift-v5 @ dd3d68f;pydantic 2.11.7, starlette(当前 release), tinker SDK
- Hardware: Ascend910 x2, torch_npu 2.10.0.post7
- 我们提交了 server/_compat_pickle.py 补丁(import 时生效,_LazyModule 替换之前挂载):
① State/MockValSer getattr 防护 ② tinker namespace 注入 ③ TensorData
get_pydantic_core_schema。验证:TypeAdapter(ForwardBackwardRequest) 校验通过,
create_model → forward_backward → optim_step 协议闭环。
- Lenguaje dominante
- Python
- Estrellas
- 270
- Forks
- 68
- Merge medio
- 2 d 16 h
- PR fusionados (30 d)
- 38
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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 modelscope/twinkle
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
modelscope/twinkle#429 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 55/100
modelscope/twinkle#410 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
modelscope/twinkle#408 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
modelscope/twinkle#407 ·
Los mantenedores suelen responder en 2 días
-
魔搭托管的 Twinkle API 持续超时Abiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
modelscope/twinkle#319 · 5 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de modelscope/twinkle
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choicePosiblemente ocupada @beartester34 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
modelscope/evalscope#2330 ·
Los mantenedores suelen responder en 1 día
-
Distribution plot crashes when a numeric feature is constant in the train or test setPosiblemente ocupada @adembilge la tomó hoy. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
MAIF/shapash#847 · 1 comentario ·
Los mantenedores suelen responder en 10 días
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
namespace team:operations
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
EclipseFdn/open-vsx.org#16738 ·
Los mantenedores suelen responder en 1 día