I disabled some tests temporarily. I will move them to a separated executable file in another PR.
In the future, I want to combine onnxruntime::Environment and OrtEnv classes. Now we have 3 env classes, it is too confusing:
1. onnxruntime::Env
2. onnxruntime::Environment
3. OrtEnv
Our python binding uses onnxruntime::Environment, while all other language bindings use OrtEnv. So python doesn't unload EPs but the others do. It's better to make them consistent.
Please note even I added the call, currently the unload function still is a no-op on Linux. So, currently on Windows we must unload the EPs while on Linux we must not do it.
* Improve transfered time from ort to torch
* Use static_cast
* fix call to Python API for python <= 3.8
* investigation
* fix ref counts
* disable import if no training
* one function to convert multiple ortvalues
* add proto_type
* enforce dlpack->deleter to be not null
* fix _ortvalues_to_torch_tensor for eager mode
* rename proto_type into element_type in the Python API
* conversion from ort to torch 2x times faster
* fix conversion of list of OrtValue
* replace has_bool_tensor by bool_tensor_indices
* introduce _ortvalues_to_torch_tensor_list
* use _ortvalues_to_torch_tensor_list for cache
* fix ambiguity between c and python classes
Co-authored-by: xavier dupré <xavier.dupre@gmail.com>
Co-authored-by: Thiago Crepaldi <thiago.crepaldi@microsoft.com>
* adding fill scalar for torch ones direct initialization on device and adding test case for it
* using ConstantOfShape to for implementing fill Scalar in atenops
* adding case for handling at::Tensor attribute
* handling the at::Tensor type for ConstantOfShape
* handling the at::Tensor type for ConstantOfShape with attr type
* handling the at::Tensor type case
* converting the data to tensor in case of aten tensor mapping is needed
* handling aten tensor case
* handling aten tensor case and reversing the string case
* changing type of scalar
* improve NonZero
* fix megatron_fp16 optimzier, fix the doc
* multi_tensor_applier
* resolve comment
* fix building warning
* fix build error when enabling training and use tensorrt
* Adding optimization step and step parameter to the ORTTrainer constructor
* Added ORTTrainerOptions for optimization step
* Adding Train Step Info Settings to State Dictionary
* Adding train step info key
* Updating comments
* Reverting changes
* Updating test case for new state dict entry train_step_info
* Update DropoutGrad function to support bfloat16
* Eliminate dead comments
* Set opset version for testcase
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
* Update to new builder
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
* restore random states after export_model
* move get/set_random_states inside _export_model
* add comments for random state save/restore
* add unit test for random state check
* resolve comments
* fix error
Add runtime optimization support to ONNX -> ORT format conversion script.
Replace `--optimization_level`, `--use_nnapi`, and `--use_coreml` with a new `--optimization_style` option.
* creating a test for printing ort tensor
* modifying comment for error case
* Using Output Grabber to assert the print output
* modifying the print ort test
* removing comments
* removing sys import
Current training optimizer kernels include CPU headers
that affects changes that we can make in the CPU code with C++14 compiler and
other refactoring efforts. Rearrange the kernel according to the established patterns
and do not include headers that are not needed.
Work on minimizing memory management calls by
reducing number of allocations and copies.
Replace std::unordered_set to InlinedHashSet
and add usage of InlinedVector.
Employ std::move() to minimize copying and memory allocations.
Remove copying of the const shared data into each of the
PropagateCast transformer instances.
Move inlined_containers.h header to include/common
Adjust AsSpan imlementation for C++ < 17
* Fix incorrect type constraint registration for RoiAlign. This led to the input type not actually being checked when matching a kernel as the invalid constraint name is treated as a missing optional input.
* fix missing dependency for the unit test exe. Whilst it doesn't link against the CUDA providers lib, without the dependency VS doesn't know it needs to rebuild the library if there are changes.
* Add check for invalid type constraints.
* Fix invalid registrations for other kernels.
* Add hash replacement logic to provide backwards compatibility in ORT format models when the registration is fixed.
* Add tests