A question about backward propagation speed in cpp extension in tutorial
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 15/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Bereich
- performance
Rechercherichtung
Start by running benchmark.py with the py and cpp arguments, with and without --runs 10000, to reproduce the reported gap in backward time. The report gives no explanation for why the C++ backward path is slower than the Python one, so the work is to find the cause in the extension's backward implementation. Done means either a fix that brings backward timing in line with the Python version, or a written explanation of the gap.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
When submitting a bug report, please include the following information (where relevant):
- OS: Kubuntu 20.04
- PyTorch version: 1.7.0+cpu
- How you installed PyTorch (conda, pip, source): pip
- Python version: 3.8.5
- CUDA/cuDNN version: None
- GPU models and configuration: None
- GCC version (if compiling from source): 9.3.0
hello, everyone. I have a question about backward propagation speed in writing cpp extension.
I download the source code of "Custom C++ and CUDA extensions" in PyTorch Tutorial, which is at https://github.com/pytorch/extension-cpp .
when I ran benchmark.py, I found that the backward propagation time in cpp is much longer than that in python. I really do not know why this happen.
The result is listed as below. And I use the original code in extension-cpp repo.
(base) wmf997@wmf997-E743-Q7C08:~/extension-cpp-master$ python benchmark.py py
Forward: 246.525/250.680 us | Backward 365.973/376.601 us
(base) wmf997@wmf997-E743-Q7C08:~/extension-cpp-master$ python benchmark.py cpp
Forward: 178.099/180.986 us | Backward 536.442/549.297 us
I ran 10000 times, and the result is listed as below. (the result above ran 100 times)
(base) wmf997@wmf997-E743-Q7C08:~/extension-cpp-master$ python benchmark.py --runs 10000 py
Forward: 245.571/334.904 us | Backward 363.827/486.081 us
(base) wmf997@wmf997-E743-Q7C08:~/extension-cpp-master$ python benchmark.py --runs 10000 cpp
Forward: 177.860/290.786 us | Backward 537.395/834.295 us
I run my code on Kubuntu 20.04, with Python 3.8.5(Anaconda) and PyTorch 1.7.0+cpu installed. The CPU is intel core i7-3540m.
- Vorherrschende Sprache
- Python
- Sterne
- 1.2k
- Forks
- 250
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus pytorch/extension-cpp
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
pytorch/extension-cpp#100 · 5 Kommentare ·
-
Deprecation warningOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
pytorch/extension-cpp#82 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
pytorch/extension-cpp#124 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
pytorch/extension-cpp#123 ·
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 12/100
pytorch/extension-cpp#121 · 3 Kommentare ·
Alle Issues in pytorch/extension-cpp
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Evtl. vergeben @cestercian hat das heute übernommen. Offencomp/cli P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
NousResearch/hermes-agent#162259 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[request] gRpc/1.86.0Offenupstream update
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
conan-io/conan-center-index#31597 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
AOSSIE-Org/PictoPy#1802 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
community-request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NVIDIA-NeMo/Run#727 ·
Maintainer antworten meist innerhalb von 1 Tag