pytorch / torchx

TorchX is a universal job launcher for PyTorch applications. TorchX is designed to have fast iteration time for training/research and support for E2E production ML pipelines when you're ready.
https://pytorch.org/torchx
Other
324 stars 108 forks source link

Using torchx as a SDK #945

Open juinquok opened 3 weeks ago

juinquok commented 3 weeks ago

❓ Questions and Help

Please note that this issue tracker is not a help form and this issue will be closed.

Before submitting, please ensure you have gone through our documentation.

Question

The examples on the documentation refer to using torchx via the cli implementation. I was wondering if there was any way that torchx can be used in a sdk format. For instance:

class MyCustomComponent

class MyScheduler

runner = torchx.runner()
runner.with_scheduler(MyScheduler())
runner.run_component(MyCustomComponent())

If its possible, is there any documentation or a sample project that provides an example of how this can be used, in particular using a custom scheduler and component?

Thank You!

tonykao8080 commented 3 weeks ago

Please refer to https://pytorch.org/torchx/latest/runner.html#torchx-runner for example of calling Torchx runner in python code.