Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CodeGen Bug #10105

Merged
merged 17 commits into from
Apr 18, 2023
Merged

Fix CodeGen Bug #10105

merged 17 commits into from
Apr 18, 2023

Conversation

howin98
Copy link
Contributor

@howin98 howin98 commented Apr 11, 2023

No description provided.

@howin98 howin98 changed the title refactor cast ofops to signless Fix CodeGen Bug Apr 12, 2023
@howin98 howin98 marked this pull request as ready for review April 17, 2023 02:35
@github-actions
Copy link
Contributor

Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally.

Copy link
Contributor

@BBuf BBuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}
}
if (op.getOutput().getUses().empty()) { return failure(); }
VariableOp cloned = rewriter.create<VariableOp>(op->getLoc(), op.getResultTypes(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里叫casted会不会语意更明确点

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

❌ OneFlow resnet50 time: 141.4ms (= 14141.6ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 148.1ms (= 14811.6ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.05 (= 148.1ms / 141.4ms)

OneFlow resnet50 time: 83.2ms (= 8317.2ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 91.9ms (= 9185.4ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.10 (= 91.9ms / 83.2ms)

OneFlow resnet50 time: 51.4ms (= 10284.6ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 66.5ms (= 13301.6ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.29 (= 66.5ms / 51.4ms)

OneFlow resnet50 time: 33.9ms (= 6784.3ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 64.1ms (= 12820.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.89 (= 64.1ms / 33.9ms)

OneFlow resnet50 time: 27.4ms (= 5478.1ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 62.9ms (= 12573.6ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 2.30 (= 62.9ms / 27.4ms)

OneFlow swin dataloader time: 0.237s (= 47.488s / 200, num_workers=1)
PyTorch swin dataloader time: 0.151s (= 30.251s / 200, num_workers=1)
Relative speed: 0.637 (= 0.151s / 0.237s)

OneFlow swin dataloader time: 0.068s (= 13.691s / 200, num_workers=4)
PyTorch swin dataloader time: 0.041s (= 8.177s / 200, num_workers=4)
Relative speed: 0.597 (= 0.041s / 0.068s)

OneFlow swin dataloader time: 0.041s (= 8.286s / 200, num_workers=8)
PyTorch swin dataloader time: 0.023s (= 4.602s / 200, num_workers=8)
Relative speed: 0.555 (= 0.023s / 0.041s)

❌ OneFlow resnet50 time: 154.8ms (= 15484.5ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 165.9ms (= 16590.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
❌ Relative speed: 1.07 (= 165.9ms / 154.8ms)

OneFlow resnet50 time: 94.5ms (= 9450.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 104.9ms (= 10486.5ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.11 (= 104.9ms / 94.5ms)

OneFlow resnet50 time: 62.3ms (= 12454.6ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 79.0ms (= 15792.7ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.27 (= 79.0ms / 62.3ms)

OneFlow resnet50 time: 45.4ms (= 9070.6ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 72.2ms (= 14437.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.59 (= 72.2ms / 45.4ms)

OneFlow resnet50 time: 38.0ms (= 7605.8ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 74.4ms (= 14874.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.96 (= 74.4ms / 38.0ms)

@github-actions
Copy link
Contributor

View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/10105/

@mergify mergify bot merged commit 99b7126 into master Apr 18, 2023
@mergify mergify bot deleted the refactor-cast-ofops-to-signless branch April 18, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants