Skip to content

Conversation

@yzhliu
Copy link
Member

@yzhliu yzhliu commented Jul 16, 2017

It is not ready to merge, while Function.main() works.

TBD:

  • callback function finalizer
  • unit test cases
  • support more argument types: bytes
  • support more argument types: NDArray

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is important to move ownership to the java side before you return, see https://github.com/dmlc/tvm/blob/master/include/tvm/runtime/c_runtime_api.h#L269

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before you pass the arguments to the callback function, since callback funtion might want to retain the value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very likely you can reuse the same logic of implementing call in the front-end, since that is simply call into Return

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one possible bug I think I find today, since resource won't be constructed until user call asModule.

If user call asModule twice, there will be double free. If user won;t call asModule in return value. There will be memory leak

@yzhliu
Copy link
Member Author

yzhliu commented Jul 20, 2017

@tqchen It is ready for review.

* @param override Whether override existing entry.
*/
public static void register(String name, Callback function, boolean override) {
int fid = genFunctionId(function);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

@Test
public void test_reg_sum_ndarray() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To increase coverage, I would recommend to add the test that takes function as argument and returns a function

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tqchen tqchen merged commit 68c4400 into apache:master Jul 20, 2017
vinx13 pushed a commit to vinx13/tvm that referenced this pull request Mar 9, 2022
apivovarov pushed a commit to apivovarov/tvm that referenced this pull request May 5, 2022
mikepapadim pushed a commit to mikepapadim/tvm that referenced this pull request Oct 5, 2022
This PR features `match_shape` support, which contains:
- MatchShape support for both var emitting and non-emitting cases
- Allow TIR operators dtype broadcasting. (e.g. `i64 * i32`)

Co-authored-by: Ruihang Lai <[email protected]>
junrushao added a commit to junrushao/tvm that referenced this pull request Oct 18, 2022
[TVMScript] B4: If branch support (apache#263)
B8: Local Function Support  (apache#258)
[TVMScript] B3: Type annotation checks (apache#256)
[TVMScript][Parser] B1: Dataflow block (apache#252)
[TVMScript] B2: match shape support (apache#251)
[TVMScript] B6/B7: Symbolic shape and var shadowing  (apache#245)
[TVMScript] B5: Support relax op (apache#244)
[TVMScript] B0: Call_tir support (apache#243)
enhance parser error reporting (apache#242)
[TVMScript] A1: Relax Parser infra (apache#240)
update ci image versions. (apache#241)
[TVMScript] B2-4: TIR IRBuilder (apache#239)
[TVMScript] A0: Relax IRBuilder infra (apache#235)
[TVMScript] B5-6: TIR IRBuilder (apache#231)
[TVMScript] B1: IRBuilder (apache#228)
[TVMScript] New Parser: Part C (apache#218)
[TVMScript] New Parser: Part A (apache#221)
[TVMScript] New Parser: Part B (apache#217)

Not recovered:
[Pass] Separate ApplyHistoryBest from tuning passes (apache#226)
[Bugfix] Couple of bug fixes to run TVM-gen code together with BYOC (apache#249)

co-authored-by: Yuchen Jin <[email protected]>
co-authored-by: Siyuan Feng <[email protected]>
co-authored-by: Ruihang Lai <[email protected]>
MasterJH5574 added a commit to MasterJH5574/tvm that referenced this pull request Nov 20, 2022
[TVMScript] B4: If branch support (apache#263)
B8: Local Function Support  (apache#258)
[TVMScript] B3: Type annotation checks (apache#256)
[TVMScript][Parser] B1: Dataflow block (apache#252)
[TVMScript] B2: match shape support (apache#251)
[TVMScript] B6/B7: Symbolic shape and var shadowing  (apache#245)
[TVMScript] B5: Support relax op (apache#244)
[TVMScript] B0: Call_tir support (apache#243)
enhance parser error reporting (apache#242)
[TVMScript] A1: Relax Parser infra (apache#240)
update ci image versions. (apache#241)
[TVMScript] B2-4: TIR IRBuilder (apache#239)
[TVMScript] A0: Relax IRBuilder infra (apache#235)
[TVMScript] B5-6: TIR IRBuilder (apache#231)
[TVMScript] B1: IRBuilder (apache#228)
[TVMScript] New Parser: Part C (apache#218)
[TVMScript] New Parser: Part A (apache#221)
[TVMScript] New Parser: Part B (apache#217)

Not recovered:
[Pass] Separate ApplyHistoryBest from tuning passes (apache#226)
[Bugfix] Couple of bug fixes to run TVM-gen code together with BYOC (apache#249)

co-authored-by: Yuchen Jin <[email protected]>
co-authored-by: Siyuan Feng <[email protected]>
co-authored-by: Ruihang Lai <[email protected]>
junrushao added a commit to junrushao/tvm that referenced this pull request Feb 8, 2023
[TVMScript] B4: If branch support (apache#263)
B8: Local Function Support  (apache#258)
[TVMScript] B3: Type annotation checks (apache#256)
[TVMScript][Parser] B1: Dataflow block (apache#252)
[TVMScript] B2: match shape support (apache#251)
[TVMScript] B6/B7: Symbolic shape and var shadowing  (apache#245)
[TVMScript] B5: Support relax op (apache#244)
[TVMScript] B0: Call_tir support (apache#243)
enhance parser error reporting (apache#242)
[TVMScript] A1: Relax Parser infra (apache#240)
update ci image versions. (apache#241)
[TVMScript] B2-4: TIR IRBuilder (apache#239)
[TVMScript] A0: Relax IRBuilder infra (apache#235)
[TVMScript] B5-6: TIR IRBuilder (apache#231)
[TVMScript] B1: IRBuilder (apache#228)
[TVMScript] New Parser: Part C (apache#218)
[TVMScript] New Parser: Part A (apache#221)
[TVMScript] New Parser: Part B (apache#217)

Not recovered:
[Pass] Separate ApplyHistoryBest from tuning passes (apache#226)
[Bugfix] Couple of bug fixes to run TVM-gen code together with BYOC (apache#249)

co-authored-by: Yuchen Jin <[email protected]>
co-authored-by: Siyuan Feng <[email protected]>
co-authored-by: Ruihang Lai <[email protected]>
yelite pushed a commit to yelite/tvm that referenced this pull request Feb 17, 2023
[TVMScript] B4: If branch support (apache#263)
B8: Local Function Support  (apache#258)
[TVMScript] B3: Type annotation checks (apache#256)
[TVMScript][Parser] B1: Dataflow block (apache#252)
[TVMScript] B2: match shape support (apache#251)
[TVMScript] B6/B7: Symbolic shape and var shadowing  (apache#245)
[TVMScript] B5: Support relax op (apache#244)
[TVMScript] B0: Call_tir support (apache#243)
enhance parser error reporting (apache#242)
[TVMScript] A1: Relax Parser infra (apache#240)
update ci image versions. (apache#241)
[TVMScript] B2-4: TIR IRBuilder (apache#239)
[TVMScript] A0: Relax IRBuilder infra (apache#235)
[TVMScript] B5-6: TIR IRBuilder (apache#231)
[TVMScript] B1: IRBuilder (apache#228)
[TVMScript] New Parser: Part C (apache#218)
[TVMScript] New Parser: Part A (apache#221)
[TVMScript] New Parser: Part B (apache#217)

Not recovered:
[Pass] Separate ApplyHistoryBest from tuning passes (apache#226)
[Bugfix] Couple of bug fixes to run TVM-gen code together with BYOC (apache#249)

co-authored-by: Yuchen Jin <[email protected]>
co-authored-by: Siyuan Feng <[email protected]>
co-authored-by: Ruihang Lai <[email protected]>
MasterJH5574 added a commit to MasterJH5574/tvm that referenced this pull request Jun 14, 2023
This PR supports the reshape PrimFunc detection analysis with
iter-map-simplify, in order to better support TIR functions with dynamic
variables, which is not well handled before.

Meanwhie, this PR also keeps the existing analysis logic, so that we are
still able to cover the cases like reshape with raggedness.

Unit tests for reshape are added to ensure correctness.
MasterJH5574 pushed a commit to MasterJH5574/tvm that referenced this pull request Aug 17, 2025
* 1.79us

Co-authored-by: Hongyi Jin <[email protected]>

* 1.78us

---------

Co-authored-by: Hongyi Jin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants