relax
relax copied to clipboard
[Docs][Discuss] How should we make documentation for `call_packed`, etc., more discoverable?
I am new to using and developing Relax and I am well aware of the ongoing efforts to develop more tutorials, but I would like to make an observation about my first steps in Relax that might suggest how to improve our documentation and make it easier for others to learn the language.
Namely, I struggled a bit with a simple example of calling a packed function from Relax (this was literally the first time I wrote any Relax code) and, in particular, had trouble with figuring out the call convention for call_packed
. The tricky part of this is that since Relax is written using a decorator where call_packed
is translated to a call node, my IDE's doc lookup could not find any documentation on call_packed
(it is not implemented as a function in Python) and, indeed, grepping for call_packed
also did not yield a definition or anything with documentation. On a practical level, it would be helpful for documentation on Relax language constructs to be easily discoverable, either via finding definitions of them in the code base or at least having documentation.
@YuchenJin had the idea of including the script format's syntax in the documentation for the relevant AST nodes -- this way they would come up in searches, at least. Are there more thoughts or suggestions on making docs more discoverable? I realize a proper language specification is likely in the works for the future, but having pointers to it from the code documentation would also be helpful.
Summary of discussion from Relax community meeting:
@tqchen proposes including documentation for constructs like call_packed
in tvm.script.relax
, which would allow for IDE auto-completion and documentation lookup.
@YuchenJin points out that in the case of call_packed
, we could also add documentation to the ExternFunc
AST node to describe this issue. There is also an operator associated with call_tir
, so that would be a place to add documentation on that.
These are easily actionable proposals.