Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-05 Thread via GitHub


Lunderberg merged PR #16843:
URL: https://github.com/apache/tvm/pull/16843


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-05 Thread via GitHub


Lunderberg commented on PR #16843:
URL: https://github.com/apache/tvm/pull/16843#issuecomment-2039663093

   Rebased this PR onto main, since https://github.com/apache/tvm/pull/16844 
has now landed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-05 Thread via GitHub


Lunderberg commented on PR #16843:
URL: https://github.com/apache/tvm/pull/16843#issuecomment-2039658387

   Yup, `relax::ExternFunc` is a subclass of `BaseFunc`, and can be stored 
directly in an `IRModule`.  At some point, I want to use this to specify when 
the lookup of a `PackedFunc` in the global registry occurs.  Currently, there's 
a discrepency between Relax and TIR, where Relax performs the lookup when the 
VirtualMachine is initialized, while TIR performs the lookup just before the 
call is performed.  I'd like to make these more similar, with an `ExternFunc` 
being resolved either at initialization (declared in IRModule), at the start of 
a function (ExternFunc bound to a variable), or at the callsite (ExternFunc 
used inline).
   
   But the main impetus for that would have been the `LazyTransformParams` 
pass, and with the `LazyGetInput` accepting a callback parameter, there isn't 
as much need for it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-04 Thread via GitHub


slyubomirsky commented on PR #16843:
URL: https://github.com/apache/tvm/pull/16843#issuecomment-2038627542

   Wait, a global var can be mapped to an `ExternFunc`? That's wild.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-03 Thread via GitHub


Lunderberg commented on PR #16843:
URL: https://github.com/apache/tvm/pull/16843#issuecomment-2036071794

   The CI failure here will be resolved with 
https://github.com/apache/tvm/pull/16843.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-03 Thread via GitHub


Lunderberg commented on PR #16843:
URL: https://github.com/apache/tvm/pull/16843#issuecomment-2036068681

   The `GlobalVar` instances themselves don't need to be changed, only the 
functions to which they point.  This is why the pre-transform steps don't need 
to modify any function bodies, because the `GlobalVar` is still present in the 
`IRModule`.  After running the transform, the values from `new_subset` are only 
copied back to the original `mod` if they weren't one of the dummy `ExternFunc` 
instances.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-03 Thread via GitHub


slyubomirsky commented on PR #16843:
URL: https://github.com/apache/tvm/pull/16843#issuecomment-2036001152

   Are the substituted global vars restored afterwards? I couldn't find a place 
where they were put back. I would be worried about these extern funcs ending up 
in the final module.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-03 Thread via GitHub


Lunderberg commented on PR #16843:
URL: https://github.com/apache/tvm/pull/16843#issuecomment-2035187347

   A follow-up commit to https://github.com/apache/tvm/pull/16801


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] [IR] Provide well-formed intermediate in ApplyPassToFunction [tvm]

2024-04-03 Thread via GitHub


Lunderberg opened a new pull request, #16843:
URL: https://github.com/apache/tvm/pull/16843

   Prior to this commit, `ApplyPassToFunction` removed functions from the 
`IRModule` to hide them from the inner `ir.transform.Pass`.  The dangling 
`GlobalVar` references to those functions meant that the intermediate 
`IRModule` was ill-formed This commit updates the `ApplyPassToFunction` utility 
to instead replace the functions with `ExternFunc` nodes.  This still prevents 
the inner `ir.transform.Pass` from having visibility into functions that should 
not be mutated, but provides a well-formed `IRModule`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org