-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft][Unity] Allow dynamic indices to TupleGetItem #16002
Commits on Nov 29, 2023
-
[PR-15983][FFI] Allow IntImm arguments to PackedFunc with int parameter
TVM containers, such as tvm::runtime::Array, require the contained objects to inherit from `ObjectRef`. As a result, the wrapper types `IntImm`, `FloatImm`, and `StringImm` are often used to allow native types in the TVM containers. Conversions into these wrapper type may be required when using a container, and may be performed automatically when passing an object across the FFI. By also providing conversion to an unwrapped type, these automatic conversions are transparent become transparent to users. The trait can be specialized to add type specific conversion logic from the TVMArgvalue and TVMRetValue.
Configuration menu - View commit details
-
Copy full SHA for 85f937f - Browse repository at this point
Copy the full SHA 85f937fView commit details -
Configuration menu - View commit details
-
Copy full SHA for acfeb78 - Browse repository at this point
Copy the full SHA acfeb78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29e9327 - Browse repository at this point
Copy the full SHA 29e9327View commit details -
Configuration menu - View commit details
-
Copy full SHA for aa5dc39 - Browse repository at this point
Copy the full SHA aa5dc39View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38c0cd1 - Browse repository at this point
Copy the full SHA 38c0cd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f569eb - Browse repository at this point
Copy the full SHA 1f569ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d9a78a - Browse repository at this point
Copy the full SHA 0d9a78aView commit details -
Correct conversion of python bool to PrimValue
Because `isinstance(bool_value, int)` returns True, boolean values were being converted to `T.int64`, instead of to `T.bool`.
Configuration menu - View commit details
-
Copy full SHA for 3e19873 - Browse repository at this point
Copy the full SHA 3e19873View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7be26d5 - Browse repository at this point
Copy the full SHA 7be26d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for c98041a - Browse repository at this point
Copy the full SHA c98041aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b4245fa - Browse repository at this point
Copy the full SHA b4245faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 00c4aff - Browse repository at this point
Copy the full SHA 00c4affView commit details -
Configuration menu - View commit details
-
Copy full SHA for b9bf03b - Browse repository at this point
Copy the full SHA b9bf03bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dba439 - Browse repository at this point
Copy the full SHA 1dba439View commit details -
Revert "[PR-15983][FFI] Allow IntImm arguments to PackedFunc with int…
… parameter" This reverts commit 61f6322.
Configuration menu - View commit details
-
Copy full SHA for 8f43de7 - Browse repository at this point
Copy the full SHA 8f43de7View commit details -
[Container] Support non-nullable types in Array::Map
Prior to this commit, the `Array::Map` member function could only be applied to nullable object types. This was due to the internal use of `U()` as the default value for initializing the output `ArrayNode`, where `U` is the return type of the mapping function. This default constructor is only available for nullable types, and would result in a compile-time failure for non-nullable types. This commit replaces `U()` with `ObjectRef()` in `Array::Map`, removing this limitation. Since all items in the output array are overwritten before returning to the calling scope, initializing the output array with `ObjectRef()` does not violate type safety.
Configuration menu - View commit details
-
Copy full SHA for 8d357fb - Browse repository at this point
Copy the full SHA 8d357fbView commit details -
[FFI] Separate runtime types from IR types for int/float/bool
Prior to this commit, `int`, `float`, and `bool` arguments from Python were converted to `IntImm`, `FloatImm`, and `Bool`. These are subtypes of `PrimExpr`, and should only be used at compile-time. By automatically applying this conversion as part of the FFI, these types are required to be present whenever a primitive is converted to a `tvm::ObjectRef`. This can become especially fragile for an end-user when storing objects into a TVM container. Because TVM containers require all contents to be `ObjectRef` subclasses, an automatic conversion may be applied on storing into a container, resulting in an unexpected type being retrieved from the container. For example, this currently occurs in Relax when extracting a `R.Prim` from a `R.Tuple`. This commit introduces a `Box<T>` type for storage of boxed primitives at runtime, distinct from the IR types. * Primitive arguments provided to a PackedFunc that requires an `ObjectRef` will be converted to the corresponding boxed type. (e.g. Passing a Python `int` to a C++ function accepting `ObjectRef` produces a `Box<int64_t>`. * Boxed primitives provided to a PackedFunc that requires an unboxed primitive will be converted to the corresponding primitive. * PackedFunc return values of `ObjectRef` are converted to the corresponding primitive, if present. (e.g. If a `tuple_getitem` with static return type `ObjectRef` returns a `Box<int64_t>`, it will be unwrapped to a python `int`.) Together, these three rules provide backwards compatibility for existing PackedFunc definitions, while avoiding exposing the user to any container-induced type conversions betweeen primitive types and `ObjectRef`.
Configuration menu - View commit details
-
Copy full SHA for e739ba9 - Browse repository at this point
Copy the full SHA e739ba9View commit details -
[UnitTest] Update apache/main unit tests for Box<int>
Mostly, this requires removing `.value` unwrapping that is now applied automatically.
Configuration menu - View commit details
-
Copy full SHA for d376d76 - Browse repository at this point
Copy the full SHA d376d76View commit details -
[TIR] Update FFI conversion registration
* Change tir.Call signature accept `Array<Variant<...>>` instead of `Array<ObjectRef>`. This allows the FFI to apply registered conversions. * Update target parsing to expect the default object types. * Extend conversion into PrimExpr. Several APIs that check for a PrimExpr may now receive a `runtime.String`, `runtime.Box<bool>` or `runtime.Box<int64_t>`. These must be converted to `StringImm`, `Bool`, or `IntImm` for use in functions that accept `PrimExpr`.
Configuration menu - View commit details
-
Copy full SHA for 45c1133 - Browse repository at this point
Copy the full SHA 45c1133View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9fc7ebf - Browse repository at this point
Copy the full SHA 9fc7ebfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 924c8ff - Browse repository at this point
Copy the full SHA 924c8ffView commit details