Welcome to use OneFlow v0.5.0RC, we would love to hear feedback!
Highlights
- First class support for eager execution. The deprecated APIs are moved to
oneflow.compatible.single_client
- Drop-in replacement of
import torch
for existing Pytorch projects. You could test it by inter-changingimport oneflow as torch
andimport torch as flow
. - nn.Module for eager execution
- nn.Graph for lazy execution
- DDP for data parallel
A sneak peek of the new API
Here is a minimum example showcasing how to incorporate a nn.Module
in a nn.Graph
and have it run in lazy mode.
class NeuralGraph(flow.nn.Graph):
def __init__(self, ...):
super().__init__()
self.model = model # model is a nn.Module instance def build(self, x):
y_pred = self.model(x)
return y_predgraph = NeuralGraph() # to create a nn.Graph instance
y_pred = graph(x) # to run the created nn.Graph
Full changelog link:https://github.com/Oneflow-Inc/oneflow/releases/tag/v0.5rc1
Welcome to visit OneFlow on GitHub and follow us on Twitter and LinkedIn.
Also, welcome to join our Discord group to discuss and ask OneFlow related questions, and connect with OneFlow contributors and users all around the world.