nnsmith icon indicating copy to clipboard operation
nnsmith copied to clipboard

[Help Wanted] How to only generate sequential models

Open winnylyc opened this issue 10 months ago • 2 comments

Hello, sorry for disturbing you.

I am currently testing a machine learning compiler that only accepts sequential models. I would like to know if there is a straightforward method to configure NNSmith in a way that it exclusively generates sequential models. (The sequntial model here means the model can be implemented by only using one torch.nn.Sequential())

Looking foward to your response! Thanks a lot!

winnylyc avatar Apr 10 '24 11:04 winnylyc

Some similar feature request was proposed in #117 and implemented in #119, which aims to generate models with only one input and one output.

But that is slightly different from your goal to generate a sequential model as this mode can have parallel intermediate nodes.

But you know all models can be sequential or non-sequential per the definition of a "layer". If you regard compound operators as a whole then every multiple operator can be regarded as a compound operator leading to a sequential model. But if you look at the primary operators (such as add) then the so-called sequential models (e.g., those using transformer blocks) are actually non-sequential. i.e., I think this problem first needs to be solved by definition. :D

ganler avatar Apr 10 '24 16:04 ganler

Thank you for your quick response! The concept of the "compound operator" you mentioned is indeed relevant to the compiler I am going to test. I am currently further confirming on the extent to which the compound operator can express by the compiler.

winnylyc avatar Apr 11 '24 06:04 winnylyc