pytorch/torch/csrc/jit/runtime
Kevin Fu 4986f0f52e [PT2]: allow empty dict to pass type check (#147167) (#147480)
Summary:

Seeing errors like when testing sigmoid for inline_cvr and perevent_cvr models.
```
terminate called after throwing an instance of 'c10::Error'
  what():  forward() Expected a value of type 'Dict[int, Tuple[Tensor, Tensor, Tensor]]' for argument 'event_based_features' but instead found type 'Dict[Any, Any]'.
```
Let empty dict pass type check.

please, do NOT use any of the following flags, those are result of manual interventions in other parts of the system, misuse of them can be very painful for both detect and recover:

Test Plan:
```
MODEL_ENTITY_ID=691508446
SNAPSHOT_ID=0
OTHER_MODEL_ENTITY_ID=649645886
OTHER_SNAPSHOT_ID=0
MODULE=local

buck2 run mode/opt caffe2/torch/fb/model_transform/fx2trt/packaging:load_net_predictor -- \
    --loadMode=BenchmarkAB \
    --inputNetFile=/data/users/${USER}/models/${MODEL_ENTITY_ID}/${SNAPSHOT_ID}/${MODEL_ENTITY_ID}_${SNAPSHOT_ID}${suffix} \
    --otherNetFile=/data/users/${USER}/models/${OTHER_MODEL_ENTITY_ID}/${OTHER_SNAPSHOT_ID}/${OTHER_MODEL_ENTITY_ID}_${OTHER_SNAPSHOT_ID}${suffix} \
    --moduleName=${module} \
    --submodToDevice "" \
    --benchmarkDontRebatchSamples=true \
    --sampleInputFilePath=/data/users/${USER}/models/${MODEL_ENTITY_ID}/${SNAPSHOT_ID}/archive_.predictor.disagg.gpu.local/data/sample_inputs/local.pt
```

Reviewed By: yjhao

Differential Revision: D69871393

Pull Request resolved: https://github.com/pytorch/pytorch/pull/147480
Approved by: https://github.com/henryoier, https://github.com/jeanschmidt
2025-02-21 07:00:46 +00:00
..
interpreter Fix clang-tidy warnings in torch/jit (#146963) 2025-02-15 03:36:59 +00:00
static [PT2]: allow empty dict to pass type check (#147167) (#147480) 2025-02-21 07:00:46 +00:00
argument_spec.cpp
argument_spec.h Fix clang-tidy warnings in torch/jit (#146963) 2025-02-15 03:36:59 +00:00
autodiff.cpp
autodiff.h
calculate_necessary_args.h
custom_operator.h
decomposition_registry_util.cpp
decomposition_registry_util.h
decomposition_registry.cpp
decomposition_registry.h
exception_message.h
graph_executor_impl.h
graph_executor.cpp
graph_executor.h
graph_iterator.h
instruction.cpp
instruction.h
interpreter.cpp
interpreter.h
jit_exception.cpp Fix clang-tidy warnings in torch/jit (#146963) 2025-02-15 03:36:59 +00:00
jit_exception.h
jit_trace.cpp
jit_trace.h
logging.cpp
logging.h Fix clang-tidy warnings in torch/jit (#146963) 2025-02-15 03:36:59 +00:00
operator_options.h
operator.cpp
operator.h
print_handler.cpp
print_handler.h
profiling_graph_executor_impl.cpp
profiling_graph_executor_impl.h
profiling_record.cpp
profiling_record.h
register_c10_ops.cpp
register_cuda_ops.cpp
register_distributed_ops.cpp
register_ops_utils.cpp
register_ops_utils.h
register_prim_ops_fulljit.cpp
register_prim_ops.cpp Fix clang-tidy warnings in torch/jit (#146963) 2025-02-15 03:36:59 +00:00
register_special_ops.cpp
script_profile.cpp
script_profile.h
serialized_shape_function_registry.cpp
serialized_shape_function_registry.h
shape_function_registry.h
simple_graph_executor_impl.cpp
simple_graph_executor_impl.h
slice_indices_adjust.cpp
slice_indices_adjust.h
symbolic_script.cpp
symbolic_script.h
symbolic_shape_registry_util.cpp
symbolic_shape_registry_util.h
symbolic_shape_registry.cpp
symbolic_shape_registry.h
vararg_functions.cpp
vararg_functions.h
variable_tensor_list.h