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 dynamo mock error #10318

Merged
merged 13 commits into from
Aug 29, 2023
Merged

Fix dynamo mock error #10318

merged 13 commits into from
Aug 29, 2023

Conversation

strint
Copy link
Contributor

@strint strint commented Aug 23, 2023

No description provided.

@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.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.8ms (= 4382.1ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.3ms (= 5729.8ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.31 (= 57.3ms / 43.8ms)

OneFlow resnet50 time: 25.8ms (= 2582.7ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 37.7ms (= 3767.9ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.46 (= 37.7ms / 25.8ms)

OneFlow resnet50 time: 19.0ms (= 3804.2ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 36.9ms (= 7372.4ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.94 (= 36.9ms / 19.0ms)

OneFlow resnet50 time: 18.4ms (= 3672.1ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 31.8ms (= 6351.6ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.73 (= 31.8ms / 18.4ms)

OneFlow resnet50 time: 17.8ms (= 3569.4ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 29.4ms (= 5883.8ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.65 (= 29.4ms / 17.8ms)

OneFlow swin dataloader time: 0.202s (= 40.441s / 200, num_workers=1)
PyTorch swin dataloader time: 0.128s (= 25.684s / 200, num_workers=1)
Relative speed: 0.635 (= 0.128s / 0.202s)

OneFlow swin dataloader time: 0.055s (= 11.097s / 200, num_workers=4)
PyTorch swin dataloader time: 0.034s (= 6.729s / 200, num_workers=4)
Relative speed: 0.606 (= 0.034s / 0.055s)

OneFlow swin dataloader time: 0.030s (= 5.927s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.323s / 200, num_workers=8)
Relative speed: 0.561 (= 0.017s / 0.030s)

❌ OneFlow resnet50 time: 47.5ms (= 4755.0ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 63.2ms (= 6317.6ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.33 (= 63.2ms / 47.5ms)

OneFlow resnet50 time: 31.8ms (= 3176.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 45.1ms (= 4505.7ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.42 (= 45.1ms / 31.8ms)

OneFlow resnet50 time: 23.9ms (= 4786.2ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 40.8ms (= 8166.5ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.71 (= 40.8ms / 23.9ms)

OneFlow resnet50 time: 21.3ms (= 4254.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.7ms (= 7349.1ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.73 (= 36.7ms / 21.3ms)

OneFlow resnet50 time: 21.0ms (= 4205.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 35.7ms (= 7135.4ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.70 (= 35.7ms / 21.0ms)

@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.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.7ms (= 4365.2ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 57.7ms (= 5771.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.32 (= 57.7ms / 43.7ms)

OneFlow resnet50 time: 25.9ms (= 2590.4ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 37.6ms (= 3756.8ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.45 (= 37.6ms / 25.9ms)

OneFlow resnet50 time: 19.2ms (= 3838.9ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 36.3ms (= 7261.3ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.89 (= 36.3ms / 19.2ms)

OneFlow resnet50 time: 18.7ms (= 3747.8ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 34.0ms (= 6808.8ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.82 (= 34.0ms / 18.7ms)

OneFlow resnet50 time: 18.2ms (= 3641.1ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 29.6ms (= 5927.5ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.63 (= 29.6ms / 18.2ms)

OneFlow swin dataloader time: 0.202s (= 40.381s / 200, num_workers=1)
PyTorch swin dataloader time: 0.128s (= 25.653s / 200, num_workers=1)
Relative speed: 0.635 (= 0.128s / 0.202s)

OneFlow swin dataloader time: 0.054s (= 10.845s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.639s / 200, num_workers=4)
Relative speed: 0.612 (= 0.033s / 0.054s)

OneFlow swin dataloader time: 0.031s (= 6.275s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.332s / 200, num_workers=8)
Relative speed: 0.531 (= 0.017s / 0.031s)

❌ OneFlow resnet50 time: 47.6ms (= 4764.8ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 64.8ms (= 6479.3ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.36 (= 64.8ms / 47.6ms)

OneFlow resnet50 time: 30.8ms (= 3082.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 45.7ms (= 4571.6ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.48 (= 45.7ms / 30.8ms)

OneFlow resnet50 time: 24.0ms (= 4800.1ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 41.8ms (= 8366.6ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.74 (= 41.8ms / 24.0ms)

OneFlow resnet50 time: 22.0ms (= 4405.3ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 37.3ms (= 7452.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.69 (= 37.3ms / 22.0ms)

OneFlow resnet50 time: 21.1ms (= 4212.1ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 34.2ms (= 6837.1ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.62 (= 34.2ms / 21.1ms)

@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.

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.6ms (= 4360.5ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 61.0ms (= 6097.6ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.40 (= 61.0ms / 43.6ms)

OneFlow resnet50 time: 26.1ms (= 2611.0ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 38.0ms (= 3795.1ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.45 (= 38.0ms / 26.1ms)

OneFlow resnet50 time: 18.8ms (= 3754.9ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 34.9ms (= 6977.7ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.86 (= 34.9ms / 18.8ms)

OneFlow resnet50 time: 18.4ms (= 3675.2ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 33.1ms (= 6624.1ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.80 (= 33.1ms / 18.4ms)

OneFlow resnet50 time: 17.9ms (= 3584.8ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 28.4ms (= 5676.4ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.58 (= 28.4ms / 17.9ms)

OneFlow swin dataloader time: 0.202s (= 40.363s / 200, num_workers=1)
PyTorch swin dataloader time: 0.128s (= 25.621s / 200, num_workers=1)
Relative speed: 0.635 (= 0.128s / 0.202s)

OneFlow swin dataloader time: 0.053s (= 10.684s / 200, num_workers=4)
PyTorch swin dataloader time: 0.033s (= 6.592s / 200, num_workers=4)
Relative speed: 0.617 (= 0.033s / 0.053s)

OneFlow swin dataloader time: 0.031s (= 6.271s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.379s / 200, num_workers=8)
Relative speed: 0.539 (= 0.017s / 0.031s)

❌ OneFlow resnet50 time: 48.0ms (= 4800.4ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 63.2ms (= 6323.2ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.32 (= 63.2ms / 48.0ms)

OneFlow resnet50 time: 30.5ms (= 3051.8ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 44.8ms (= 4476.0ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.47 (= 44.8ms / 30.5ms)

OneFlow resnet50 time: 24.0ms (= 4790.4ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 41.7ms (= 8336.0ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.74 (= 41.7ms / 24.0ms)

OneFlow resnet50 time: 21.6ms (= 4310.7ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 37.5ms (= 7499.4ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.74 (= 37.5ms / 21.6ms)

OneFlow resnet50 time: 21.5ms (= 4291.3ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 34.1ms (= 6815.8ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.59 (= 34.1ms / 21.5ms)

@github-actions
Copy link
Contributor

Speed stats:

@github-actions
Copy link
Contributor

Speed stats:

@strint strint mentioned this pull request Aug 25, 2023
@hjchen2 hjchen2 enabled auto-merge (squash) August 28, 2023 08:14
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: NVIDIA GeForce RTX 3080 Ti 

❌ OneFlow resnet50 time: 43.7ms (= 4372.9ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 61.1ms (= 6114.4ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.40 (= 61.1ms / 43.7ms)

OneFlow resnet50 time: 25.9ms (= 2587.3ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 37.2ms (= 3716.8ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.44 (= 37.2ms / 25.9ms)

OneFlow resnet50 time: 18.8ms (= 3757.1ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 35.5ms (= 7104.6ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.89 (= 35.5ms / 18.8ms)

OneFlow resnet50 time: 18.1ms (= 3614.1ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 32.2ms (= 6434.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.78 (= 32.2ms / 18.1ms)

OneFlow resnet50 time: 18.1ms (= 3619.6ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 30.5ms (= 6098.3ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 1.68 (= 30.5ms / 18.1ms)

OneFlow swin dataloader time: 0.200s (= 39.996s / 200, num_workers=1)
PyTorch swin dataloader time: 0.129s (= 25.900s / 200, num_workers=1)
Relative speed: 0.648 (= 0.129s / 0.200s)

OneFlow swin dataloader time: 0.055s (= 11.019s / 200, num_workers=4)
PyTorch swin dataloader time: 0.032s (= 6.410s / 200, num_workers=4)
Relative speed: 0.582 (= 0.032s / 0.055s)

OneFlow swin dataloader time: 0.030s (= 6.029s / 200, num_workers=8)
PyTorch swin dataloader time: 0.017s (= 3.301s / 200, num_workers=8)
Relative speed: 0.548 (= 0.017s / 0.030s)

❌ OneFlow resnet50 time: 47.7ms (= 4769.7ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 63.9ms (= 6390.3ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.34 (= 63.9ms / 47.7ms)

OneFlow resnet50 time: 31.8ms (= 3179.3ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 44.4ms (= 4439.8ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.40 (= 44.4ms / 31.8ms)

OneFlow resnet50 time: 24.1ms (= 4813.1ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 40.0ms (= 8008.4ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.66 (= 40.0ms / 24.1ms)

OneFlow resnet50 time: 21.8ms (= 4351.9ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 36.5ms (= 7301.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.68 (= 36.5ms / 21.8ms)

OneFlow resnet50 time: 20.8ms (= 4163.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 35.5ms (= 7092.2ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.70 (= 35.5ms / 20.8ms)

@github-actions
Copy link
Contributor

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

@hjchen2 hjchen2 merged commit e4118c7 into master Aug 29, 2023
37 of 39 checks passed
@hjchen2 hjchen2 deleted the fix_dynamo_mock_error branch August 29, 2023 11:12
elif (
_is_raw_type(self._value, dict)
or _is_raw_type(self._value, OrderedDict)
or _is_raw_type(self._value, list)
or _is_raw_type(self._value, tuple)
):
pass
repr_str += ", value: " + repr(self._value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个和最后的else看着没区别了吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个和最后的else看着没区别了吗?

嗯,处理方式是一样的,先保留了判断逻辑,后面要区分处理可以复用下。

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.

4 participants