onnxruntime/include/onnxruntime/core/framework
Xavier Dupré 5930e7e22f
Introduce RemovableAttributes (#14868)
### Description
TreeEnsemble* kernels fully copies all the parameters from the onnx
graph. Even if they are no longer needed or unused (hitrates), they
remain in memory. For big models >= 200 trees, max_depth > 10, the model
usually weights more than 10 Mb. This change offers a kernel the
possibility to remove all unneeded attributes after they were used to
create the session. Attributes are deleted after the model was possibly
saved, at the of the session creation.

The current design is to be debatted:
* it stored the list of removable attributes in class
`onnxruntime::Node`,
* the node is marked as `const` everytime this implementation needs to
register the name of a removable attribute or to remove them.

The current implementation is just a POC as it needs to cast
`onnxruntime::Node*` into `const onnxruntime::Node*`.

Should we keep the list of removable attributes in `onnxruntime::Node`?

### Motivation and Context
Motivation is mostly to reduce memory consumption.

---------

Signed-off-by: xadupre <xadupre@microsoft.com>
2023-03-07 12:37:12 +01:00
..
alloc_kind.h Add New AllocKind for YieldOp Outputs, Run YieldOp with InferenceSession in UT (#7125) 2021-03-25 15:18:51 +08:00
allocator.h Address follow-up comments on multistream pr #13495 (#13992) 2023-01-03 16:33:36 -08:00
buffer_deleter.h Multi-stream execution support (#13495) 2022-12-15 07:39:29 -08:00
customregistry.h Sync ORTModule branch with master and fix tests (#6526) 2021-02-02 08:59:56 -08:00
data_types.h Switch GSL to MS GSL 4.0.0 (#13416) 2022-10-29 04:15:20 -07:00
data_types_internal.h Remove CUDA 10.2 support (#12541) 2022-08-10 22:46:41 -07:00
endian.h
execution_provider.h remove device_id parameter out of ExecutionProvider::GetAllocator() (#14580) 2023-02-13 10:01:07 -08:00
float16.h [ROCm] float16.h should use __HIP__ not USE_ROCM (#13684) 2022-12-13 15:34:42 -08:00
framework_common.h
func_api.h Sync ORTModule branch with master and fix tests (#6526) 2021-02-02 08:59:56 -08:00
kernel_def_builder.h Decouple strided tensor support from ENABLE_TRAINING (#13829) 2022-12-07 09:22:21 -08:00
kernel_registry.h Changes to support standalone custom ops in a minimal build. (#14497) 2023-03-01 11:22:54 +10:00
op_kernel.h Introduce RemovableAttributes (#14868) 2023-03-07 12:37:12 +01:00
op_kernel_context.h Address follow-up comments on multistream pr #13495 (#13992) 2023-01-03 16:33:36 -08:00
op_kernel_info.h Changes to support standalone custom ops in a minimal build. (#14497) 2023-03-01 11:22:54 +10:00
op_node_proto_helper.h Switch GSL to MS GSL 4.0.0 (#13416) 2022-10-29 04:15:20 -07:00
ort_value.h Enable Opset11 Sequence Ops on DirectML, and make the CPU implementations agnostic to backend EP (#14442) 2023-02-21 18:08:28 -08:00
ortdevice.h Add CANN EP (#12416) 2022-09-22 14:53:40 -07:00
ortmemoryinfo.h Update kernel matching logic: decouple from op schemas and remove kernel def hashes (#12791) 2022-09-20 14:24:59 -07:00
provider_options.h Sync ORTModule branch with master and fix tests (#6526) 2021-02-02 08:59:56 -08:00
provider_options_utils.h Plug n Allocate with external CUDA allocator via PyBind. (#6679) 2021-02-17 18:59:38 -08:00
provider_shutdown.h
run_options.h Adding RunOptions synchronization behaviour to C/C++ API (#14088) 2023-02-07 19:59:28 -08:00
sparse_tensor.h Improve compatibility with certain STL's 2023-02-21 14:06:16 -08:00
stream_handles.h Multi-stream execution support (#13495) 2022-12-15 07:39:29 -08:00
tensor.h Enable Opset11 Sequence Ops on DirectML, and make the CPU implementations agnostic to backend EP (#14442) 2023-02-21 18:08:28 -08:00
tensor_shape.h Switch GSL to MS GSL 4.0.0 (#13416) 2022-10-29 04:15:20 -07:00
to_tensor_proto_element_type.h Consolidate utils::ToTensorProtoElementType, TypeToDataType, and data_types_internal::ToTensorDataType. (#9824) 2022-04-20 12:45:53 -07:00