Skip to content

Conversation

@zdevito
Copy link
Contributor

@zdevito zdevito commented Dec 4, 2025

Stack from ghstack (oldest at bottom):

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

  • importing monarch drops from ~3 seconds to 70ms !!!
  • importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
  • The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
  • Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
  • It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
  • Less critical need for "torch vs no-torch" bindings.

Differential Revision: D88338645

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 4, 2025
zdevito added a commit that referenced this pull request Dec 4, 2025
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

ghstack-source-id: 326994832
Pull Request resolved: #2046
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 326995989
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 326996723
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 326999559
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327164640
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327171516
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327173600
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327177327
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 4, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327194834
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 5, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327293747
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 5, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327430019
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 5, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327431181
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 5, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327445960
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 5, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327462738
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 5, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327480864
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
zdevito added a commit that referenced this pull request Dec 5, 2025
Pull Request resolved: #2046

This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.
ghstack-source-id: 327481295
@exported-using-ghexport

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)
@zdevito zdevito mentioned this pull request Dec 5, 2025
This replaces torch-sys, with torch-sys2, which are much simpler binings to torch that route through pyo3. This allows us to drop the linking against torch.

There are significant advantages now:

* importing monarch drops from ~3 seconds to 70ms !!!
* importing monarch was the primary reason why things felt slow: every time we started a new process it had to import this stuff, and a lot of those process starts got serialized. Now they they are fast iteration will feel much faster.
* The monarch library can work with any somewhat recent version of torch. No need to match monarch to torch. This should make packaging orders of magnitude easier.
* Monarch itself is now smalliish at 70MB and can easily be distributed in many places. Torch does not have to be installed in those places for it to work.
* It offers teh possibility to statically link libcudart, and rdma, making monarch no longer have any library dependencies. It is much more likely we can "inject" the monarch packages in various python distributions to make monarch work in them.
* Less critical need for "torch vs no-torch" bindings.

Differential Revision: [D88338645](https://our.internmc.facebook.com/intern/diff/D88338645/)

[ghstack-poisoned]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants