You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by Meteorix <no...@github.com.INVALID> on 2021/08/24 14:17:46 UTC

[apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

This RFC add a `PyTorchTVM` module to support: compile TorchScript to TVM and use accelerated module in PyTorch.

Initial PR:  https://github.com/apache/tvm/pull/8777

Discuss: https://discuss.tvm.apache.org/t/rfc-pytorchtvm-compile-torchscript-to-tvm-and-use-accelerated-module-in-pytorch/10873
You can view, comment on, or merge this pull request online at:

  https://github.com/apache/tvm-rfcs/pull/25

-- Commit Summary --

  * Create 0025-add-pytorch-tvm.md

-- File Changes --

    A rfcs/0025-add-pytorch-tvm.md (265)

-- Patch Links --

https://github.com/apache/tvm-rfcs/pull/25.patch
https://github.com/apache/tvm-rfcs/pull/25.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Meteorix <no...@github.com.INVALID>.
@hogepodge @tqchen thanks for your advices. I have updated the PR.  

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-917983427

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Ting Hu <no...@github.com.INVALID>.
Can this method split the graph automaticly given a torchscript, and convert the subgraph that tvm Relay IR can support or tvm outperforming pytorch?

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-915849025

RE: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by ZHENG Jianwei <ji...@ust.hk>.
Unsubscribe



Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows



From: Junru Shao<ma...@github.com.INVALID>
Sent: Thursday, September 2, 2021 10:40 AM
To: apache/tvm-rfcs<ma...@noreply.github.com>
Cc: Subscribed<ma...@noreply.github.com>
Subject: Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)



@Meteorix Thanks for your responds! I just updated the comments according to your feedback. Don't hesitate to ping me if you need any inputs. Thanks a lot!

--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Ftvm-rfcs%2Fpull%2F25%23issuecomment-911064462&amp;data=04%7C01%7Cjianweizheng%40ust.hk%7C9d67ecd4c5c744ebb4d408d96dbaf6a9%7Cc917f3e2932249269bb3daca730413ca%7C1%7C0%7C637661472038884770%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=406fjhslENYl7mptwAHb4GEi0G08zCOf4BhMACA%2FopA%3D&amp;reserved=0

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Junru Shao <no...@github.com.INVALID>.
@Meteorix Thanks for your responds! I just updated the comments according to your feedback. Don't hesitate to ping me if you need any inputs. Thanks a lot!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-911064462

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by masahi <no...@github.com.INVALID>.
Is this supposed to be useful for accelerating PyTorch training?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-905322526

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Junru Shao <no...@github.com.INVALID>.
Merged #25 into main.

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#event-5296055520

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by masahi <no...@github.com.INVALID>.
cc @t-vi

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-904951973

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Meteorix <no...@github.com.INVALID>.
> I wonder whether this would make the torch fallback op ([apache/tvm#7401](https://github.com/apache/tvm/pull/7401)) more or less useful (it would depend on what you (plan to) do with unsupported ops). I am still pondering whether to close it or dust it off.

@t-vi It will help a lot. If we have the torch fallback op support, users will less likely to get stuck in frontend conversion phase. We are looking forward to this feature. Could you complete the PR? 

> I should note that as far as I know NVidia has a TensorRT front end serving a similar goal and there also is one for ONNXRuntime-as-a-module (recently featured in the PyTorch blog). There may be useful design insights in how they work (or maybe they're too different to what you have in mind).

And thanks for this information. Actually, we are inspired by another NVIDIA work: [TRTorch](https://github.com/NVIDIA/TRTorch). 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-908041324

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Tianqi Chen <no...@github.com.INVALID>.
Thanks for the great work, a minor note on rendering. it would be great to add the codeblock type to the code so we have syntax highlights

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-916903681

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Junru Shao <no...@github.com.INVALID>.
Thanks again for the contribution! I have no doubt that it is going to be hugely important piece of work. Just made some suggestions in terms of wording.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-907911081

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Junru Shao <no...@github.com.INVALID>.
It seems that we all reach consensus and no more comments are raised for several days, let's get this RFC finally merged! 🔥 🎉 

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-918661725

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Meteorix <no...@github.com.INVALID>.
> Is this supposed to be useful for accelerating PyTorch training?

From my perspective, we are a little far from supporting PyTorch training. I can think of 2 possible ways:
1. use torchscript to train
2. use relay to train

It seems both ways are in early stage. Maybe we can further discuss the possibility, but not in the scope of this RFC.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-906066691

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Junru Shao <no...@github.com.INVALID>.
@masahi @t-vi Please take another look :-) 

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-916379086

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Thomas Viehmann <no...@github.com.INVALID>.
I wonder whether this would make the torch fallback op (https://github.com/apache/tvm/pull/7401) more or less useful (it would depend on what you (plan to) do with unsupported ops). I am still pondering whether to close it or dust it off.

I should note that as far as I know NVidia has a TensorRT front end serving a similar goal and there also is one for ONNXRuntime-as-a-module (recently featured in the PyTorch blog). There may be useful design insights in how they work (or maybe they're too different to what you have in mind).


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-907192105

Re: [apache/tvm-rfcs] [RFC]PyTorchTVM (#25)

Posted by Junru Shao <no...@github.com.INVALID>.
Thanks for the nice RFC @Meteorix! It is definitely super important direction to embed TVM into PyTorch. I will read it carefully later this week.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm-rfcs/pull/25#issuecomment-904959336