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

Add more documentation #7849

Merged
merged 24 commits into from
Mar 28, 2022
Merged

Add more documentation #7849

merged 24 commits into from
Mar 28, 2022

Conversation

wyg1997
Copy link
Contributor

@wyg1997 wyg1997 commented Mar 21, 2022

Check list

autograd.backward ✅
autograd.autograd ✅
Tensor.grad ✅
Tensor.grad_fn ✅
Tensor.is_lazy ✅
Tensor.is_leaf ✅
Tensor.requires_grad ✅
Tensor.requires_grad_ ✅
Tensor.register_hook ✅
retain_grad ✅

Bugfix

使 pybind11 导出类的派生类可以为没有重写的方法添加文档

@doombeaker
Copy link
Contributor

doombeaker commented Mar 22, 2022

而且不少 C++ 里直接导出的方法,如果第一行不写函数原型的话,可能会导致 sphinx 自动提取的 signature 是错的(是无参无返回值的),或者很复杂(暴露内部类型)

可以参考下这个 PR:https://github.com/Oneflow-Inc/oneflow/pull/7834/files

@wyg1997 wyg1997 requested a review from oneflow-ci-bot March 22, 2022 12:21
@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 23, 2022 02:47
@github-actions
Copy link
Contributor

CI failed when running job: cuda-module. PR label automerge has been removed

@github-actions
Copy link
Contributor

Speed stats:

@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 24, 2022 02:36
@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 25, 2022 03:13
@github-actions
Copy link
Contributor

Speed stats:
GPU Name: GeForce GTX 1080 

✔️ OneFlow resnet50 time: 128.3ms (= 12832.0ms / 100, input_shape=[16, 3, 224, 224])
PyTorch resnet50 time: 137.4ms (= 13736.1ms / 100, input_shape=[16, 3, 224, 224])
✔️ Relative speed: 1.07 (= 137.4ms / 128.3ms)

❌ OneFlow resnet50 time: 80.8ms (= 8079.0ms / 100, input_shape=[8, 3, 224, 224])
PyTorch resnet50 time: 84.2ms (= 8418.5ms / 100, input_shape=[8, 3, 224, 224])
✔️ Relative speed: 1.04 (= 84.2ms / 80.8ms)

OneFlow resnet50 time: 52.7ms (= 10549.2ms / 200, input_shape=[4, 3, 224, 224])
PyTorch resnet50 time: 56.5ms (= 11308.3ms / 200, input_shape=[4, 3, 224, 224])
✔️ Relative speed: 1.07 (= 56.5ms / 52.7ms)

OneFlow resnet50 time: 43.6ms (= 8722.4ms / 200, input_shape=[2, 3, 224, 224])
PyTorch resnet50 time: 49.1ms (= 9826.0ms / 200, input_shape=[2, 3, 224, 224])
✔️ Relative speed: 1.13 (= 49.1ms / 43.6ms)

OneFlow resnet50 time: 39.5ms (= 7899.4ms / 200, input_shape=[1, 3, 224, 224])
PyTorch resnet50 time: 38.5ms (= 7702.5ms / 200, input_shape=[1, 3, 224, 224])
✔️ Relative speed: 0.98 (= 38.5ms / 39.5ms)

md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
build_dataset >>>>>> ImageFolder
build_dataset >>>>>> ImageFolder
✔️ Relative speed: 1.00 (= 51.0s / 51.1s)

md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
build_dataset >>>>>> ImageFolder
build_dataset >>>>>> ImageFolder
✔️ Relative speed: 1.01 (= 13.3s / 13.5s)

md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
md5 /home/ci-user/ci-cache/test_cache/onerec_test/nanodataset.zip 7f5cde8b5a6c411107517ac9b00f29db
build_dataset >>>>>> ImageFolder
build_dataset >>>>>> ImageFolder
❌ Relative speed: 0.94 (= 7.9s / 7.4s)

✔️ OneFlow resnet50 time: 135.5ms (= 13549.0ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 156.3ms (= 15630.2ms / 100, input_shape=[16, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.15 (= 156.3ms / 135.5ms)

OneFlow resnet50 time: 84.5ms (= 8449.1ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 101.5ms (= 10151.4ms / 100, input_shape=[8, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.20 (= 101.5ms / 84.5ms)

OneFlow resnet50 time: 60.9ms (= 12184.0ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 86.2ms (= 17243.5ms / 200, input_shape=[4, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.42 (= 86.2ms / 60.9ms)

OneFlow resnet50 time: 54.2ms (= 10831.8ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 66.2ms (= 13241.1ms / 200, input_shape=[2, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.22 (= 66.2ms / 54.2ms)

OneFlow resnet50 time: 48.1ms (= 9620.8ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
PyTorch resnet50 time: 64.9ms (= 12978.9ms / 200, input_shape=[1, 3, 224, 224], ddp, world size=2)
✔️ Relative speed: 1.35 (= 64.9ms / 48.1ms)

@github-actions
Copy link
Contributor

CI failed when running job: cuda-speed-test. PR label automerge has been removed

@wyg1997 wyg1997 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot March 28, 2022 01:59
@mergify mergify bot merged commit fc4fd95 into master Mar 28, 2022
@mergify mergify bot deleted the docs-add_document_wyg branch March 28, 2022 17:51
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.

3 participants