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

[feat] add split_dim arg to reversible, remove retain_grad, add benchmark_reversible #45

Merged
merged 12 commits into from Nov 1, 2021

Conversation

ClashLuke
Copy link
Contributor

This PR removes the repeated chunk and cat operations in xformers' RevNet code. This way, the RevNet implementation will become a little bit faster.
I'd strongly recommend calling a library like MemCNN or RevLib directly as they make it easier to switch the coupling function and generally give the user more freedom.

Unfortunately, I can't sign the CLA at the moment, as it keeps saying

Sorry, something went wrong.
We're working on getting this fixed as soon as we can.

@facebook-github-bot
Copy link
Contributor

Hi @ClashLuke!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@blefaudeux
Copy link
Contributor

oh, interesting, thanks for the PR @ClashLuke ! it's one of the very few parts that we did not benchmark for speed, and it does look like these lines were not optimal.. I did not know of RevLib, having a look

@blefaudeux
Copy link
Contributor

nit: if you can, I would suggest installing pre-commit, it will do the lint and formatting for you

@ClashLuke
Copy link
Contributor Author

I didn't know about pre-commit. Thanks for the recommendation!
test_reversible.py still passes, but as it doesn't test speed, I think we should also add another benchmarking script for it. Perhaps we could even test memory and runtime as with all the attention modules?

@blefaudeux
Copy link
Contributor

I didn't know about pre-commit. Thanks for the recommendation! test_reversible.py still passes, but as it doesn't test speed, I think we should also add another benchmarking script for it. Perhaps we could even test memory and runtime as with all the attention modules?

there are two utils that we are using everywhere, generates markdown tables and plots, see here

An example usage is there , should be relatively easy to grok. I can also do that if you want, as you prefer ? Many thanks already in any case !

@blefaudeux
Copy link
Contributor

@ClashLuke the broken job right now is unrelated, it's because of a change in docutils which broke sphinx, it's fixed now if you rebase onto main

@ClashLuke
Copy link
Contributor Author

ClashLuke commented Oct 28, 2021

Curiously, the speed seems to be the same. Perhaps that's because I'm running it on a GTX 1660, where memory ops are cheaper than they are on TPUs.

Upstream:

 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |1.49                |9.86                |78.80               |4.10                |32.77               |262.17              |61.40               |491.18              |3929.44             |
|reversible - fw                                 |1.29                |9.92                |78.84               |4.15                |32.84               |262.39              |61.45               |491.32              |3929.84             |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |0.78                |6.25                |49.99               |1.38                |11.03               |88.58               |10.94               |88.50               |699.83              |
|reversible - fw                                 |0.87                |6.33                |50.01               |1.46                |11.17               |88.68               |11.10               |86.53               |706.03              |


 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |4.83                |38.27               |305.89              |12.72               |101.46              |805.65              |209.72              |1677.42             |13418.66            |
|reversible - fw+bw                              |6.31                |49.18               |392.50              |17.11               |135.59              |1075.89             |271.78              |2173.06             |17383.02            |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.88                |14.42               |114.69              |3.36                |26.40               |210.58              |37.90               |304.27              |2429.77             |
|reversible - fw+bw                              |2.89                |20.98               |165.43              |4.99                |37.71               |299.12              |49.22               |389.86              |3107.68             |


=======================

Proposed:

 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |1.36                |9.85                |78.77               |4.10                |32.76               |262.09              |61.40               |491.16              |3929.18             |
|reversible - fw                                 |1.29                |9.92                |78.82               |4.15                |32.83               |262.28              |61.45               |491.23              |3960.46             |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |0.78                |6.24                |49.97               |1.39                |11.07               |88.58               |11.00               |88.47               |698.09              |
|reversible - fw                                 |0.87                |6.33                |50.05               |1.47                |11.16               |88.65               |11.15               |86.60               |706.43              |


 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                           |4.84                |38.26               |305.75              |12.72               |101.49              |811.48              |211.31              |1690.16             |13519.91            |
|reversible - fw+bw                              |6.31                |49.16               |392.29              |17.10               |135.60              |1083.42             |273.88              |2189.47             |17515.72            |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.88                |14.43               |115.08              |3.37                |26.37               |210.46              |38.07               |304.33              |2428.43             |
|reversible - fw+bw                              |2.90                |21.01               |165.99              |4.98                |37.68               |299.16              |49.25               |390.38              |3109.14             |

Running the benchmark also generated the plots below:

Upstream

RevNet_FW+bw_torch float16
RevNet_FW+bw_torch float32
RevNet_FW_torch float16
RevNet_FW_torch float32

Proposed

RevNet_FW+bw_torch float16
RevNet_FW+bw_torch float32
RevNet_FW_torch float16
RevNet_FW_torch float32

@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2021

Codecov Report

Merging #45 (c8c4dc3) into main (13d2e46) will increase coverage by 0.00%.
The diff coverage is 37.50%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #45   +/-   ##
=======================================
  Coverage   86.46%   86.46%           
=======================================
  Files          50       50           
  Lines        2393     2394    +1     
=======================================
+ Hits         2069     2070    +1     
  Misses        324      324           
Flag Coverage Δ
Python 86.46% <37.50%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
xformers/components/reversible.py 58.33% <37.50%> (+0.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 13d2e46...c8c4dc3. Read the comment docs.

@blefaudeux
Copy link
Contributor

Just for the benchmark and the extra pair of eyes the PR is completely worth it, thanks so much @ClashLuke ! Prioritizing some time to test this on a V100 and try to understand why there's no major speed impact for you

@blefaudeux
Copy link
Contributor

by the way, could you try the CLA step again @ClashLuke ? This should work (or I should look into it), and it would be perfect

@ClashLuke
Copy link
Contributor Author

ClashLuke commented Oct 28, 2021

Unfortunately, I still can't sign the CLA. In both Firefox (private and non-private) and Chrome (fresh installation), I get a 500 when it redirects me from GitHub to the callback URL.

Response HAR
{
  "log": {
    "version": "1.2",
    "creator": {
      "name": "WebInspector",
      "version": "537.36"
    },
    "pages": [
      {
        "startedDateTime": "2021-10-28T16:49:09.831Z",
        "id": "page_5",
        "title": "https://code.facebook.com/github/callback?code=b72c8c84XxxxXXXXXXXx&state=AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX",
        "pageTimings": {
          "onContentLoad": 334.2220000013185,
          "onLoad": 423.7670000002254
        }
      }
    ],
    "entries": [
      {
        "_initiator": {
          "type": "other"
        },
        "_priority": "VeryHigh",
        "_resourceType": "document",
        "cache": {},
        "pageref": "page_5",
        "request": {
          "method": "GET",
          "url": "https://code.facebook.com/github/callback?code=b72c8c84XxxxXXXXXXXx&state=AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX",
          "httpVersion": "h3",
          "headers": [
            {
              "name": ":method",
              "value": "GET"
            },
            {
              "name": ":authority",
              "value": "code.facebook.com"
            },
            {
              "name": ":scheme",
              "value": "https"
            },
            {
              "name": ":path",
              "value": "/github/callback?code=b72c8c84XxxxXXXXXXXx&state=AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX"
            },
            {
              "name": "sec-ch-ua",
              "value": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\""
            },
            {
              "name": "sec-ch-ua-mobile",
              "value": "?0"
            },
            {
              "name": "sec-ch-ua-platform",
              "value": "\"Linux\""
            },
            {
              "name": "upgrade-insecure-requests",
              "value": "1"
            },
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
            },
            {
              "name": "accept",
              "value": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
            },
            {
              "name": "sec-fetch-site",
              "value": "cross-site"
            },
            {
              "name": "sec-fetch-mode",
              "value": "navigate"
            },
            {
              "name": "sec-fetch-dest",
              "value": "document"
            },
            {
              "name": "referer",
              "value": "https://github.com/"
            },
            {
              "name": "accept-encoding",
              "value": "gzip, deflate, br"
            },
            {
              "name": "accept-language",
              "value": "en-US,en;q=0.9"
            },
            {
              "name": "cookie",
              "value": "datr=GtR6YYVcJJbU34vts4-ppUq1"
            }
          ],
          "queryString": [
            {
              "name": "code",
              "value": "b72c8c84XxxxXXXXXXXx"
            },
            {
              "name": "state",
              "value": "AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX"
            }
          ],
          "cookies": [
            {
              "name": "datr",
              "value": "GtR6YYVcJJbU34vts4-ppUq1",
              "path": "/",
              "domain": ".facebook.com",
              "expires": "2023-10-28T16:47:24.644Z",
              "httpOnly": true,
              "secure": true,
              "sameSite": "None"
            }
          ],
          "headersSize": -1,
          "bodySize": 0
        },
        "response": {
          "status": 500,
          "statusText": "",
          "httpVersion": "h3",
          "headers": [
            {
              "name": "vary",
              "value": "Accept-Encoding"
            },
            {
              "name": "content-encoding",
              "value": "br"
            },
            {
              "name": "report-to",
              "value": "{\"max_age\":86400,\"endpoints\":[{\"url\":\"https:\\/\\/www.facebook.com\\/browser_reporting\\/?minimize=0\"}],\"group\":\"coep_report\"}"
            },
            {
              "name": "content-security-policy-report-only",
              "value": "default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;"
            },
            {
              "name": "content-security-policy",
              "value": "default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;block-all-mixed-content;upgrade-insecure-requests;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;"
            },
            {
              "name": "x-fb-rlafr",
              "value": "0"
            },
            {
              "name": "cross-origin-resource-policy",
              "value": "rollout"
            },
            {
              "name": "cross-origin-embedder-policy-report-only",
              "value": "require-corp;report-to=\"coep_report\""
            },
            {
              "name": "cross-origin-opener-policy",
              "value": "same-origin-allow-popups"
            },
            {
              "name": "pragma",
              "value": "no-cache"
            },
            {
              "name": "cache-control",
              "value": "private, no-cache, no-store, must-revalidate"
            },
            {
              "name": "expires",
              "value": "Sat, 01 Jan 2000 00:00:00 GMT"
            },
            {
              "name": "x-content-type-options",
              "value": "nosniff"
            },
            {
              "name": "x-xss-protection",
              "value": "0"
            },
            {
              "name": "x-frame-options",
              "value": "DENY"
            },
            {
              "name": "strict-transport-security",
              "value": "max-age=15552000; preload"
            },
            {
              "name": "content-type",
              "value": "text/html; charset=\"utf-8\""
            },
            {
              "name": "x-fb-debug",
              "value": "MRsVGzNfew+XvWbjS9vyFk6xGIkXBmzbb9kSpt9rkmfRcWBRoU98Rks4rV+q6ggNqCSPThjDSV0a70XRVXZxBQ=="
            },
            {
              "name": "date",
              "value": "Thu, 28 Oct 2021 16:49:10 GMT"
            },
            {
              "name": "priority",
              "value": "u=3,i"
            },
            {
              "name": "alt-svc",
              "value": "h3=\":443\"; ma=3600, h3-29=\":443\"; ma=3600,h3-27=\":443\"; ma=3600"
            }
          ],
          "cookies": [],
          "content": {
            "size": 1534,
            "mimeType": "text/html",
            "text": "<!DOCTYPE html><html lang=\"en\" id=\"facebook\"><head><title>Error</title><meta charset=\"utf-8\" /><meta http-equiv=\"Cache-Control\" content=\"no-cache\" /><meta name=\"robots\" content=\"noindex,nofollow\" /><style nonce=\"dwzwdppb\">html, body { color: #333; font-family: 'Lucida Grande', 'Tahoma', 'Verdana', 'Arial', sans-serif; margin: 0; padding: 0; text-align: center;}\n#header { height: 30px; padding-bottom: 10px; padding-top: 10px; text-align: center;}\n#icon { width: 30px;}\n.core { margin: auto; padding: 1em 0; text-align: left; width: 904px;}\nh1 { font-size: 18px;}\np { font-size: 13px;}\n.footer { border-top: 1px solid #ddd; color: #777; float: left; font-size: 11px; padding: 5px 8px 6px 0; width: 904px;}</style></head><body><div id=\"header\"><a href=\"//www.facebook.com/\"><img id=\"icon\" src=\"//static.facebook.com/images/logos/facebook_2x.png\" /></a></div><div class=\"core\"><h1>Sorry, something went wrong.</h1><p>We&#039;re working on getting this fixed as soon as we can.</p><p><a id=\"back\" href=\"//www.facebook.com/\">Go Back</a></p><div class=\"footer\"> Facebook &#169; 2021 &#183; <a href=\"//www.facebook.com/help/\">Help</a></div></div><script nonce=\"dwzwdppb\">\n              document.getElementById(\"back\").onclick = function() {\n                if (history.length > 1) {\n                  history.back();\n                  return false;\n                }\n              };\n            </script></body></html><!-- @codegen-command : phps GenerateErrorPages --><!-- @generated SignedSource<<689cdacf8f7efcca0bfd866b24db1a5f>> -->"
          },
          "redirectURL": "",
          "headersSize": -1,
          "bodySize": -1,
          "_transferSize": 761,
          "_error": null
        },
        "serverIPAddress": "31.13.92.10",
        "startedDateTime": "2021-10-28T16:49:09.829Z",
        "time": 287.70799999983865,
        "timings": {
          "blocked": 1.768000000093365,
          "dns": -1,
          "ssl": -1,
          "connect": -1,
          "send": 0.14399999999999996,
          "wait": 284.7240000006328,
          "receive": 1.0719999991124496,
          "_blocked_queueing": 1.494000000093365
        }
      },
      {
        "_fromCache": "disk",
        "_initiator": {
          "type": "parser",
          "url": "https://code.facebook.com/github/callback?code=b72c8c84XxxxXXXXXXXx&state=AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX",
          "lineNumber": 6
        },
        "_priority": "High",
        "_resourceType": "image",
        "cache": {},
        "pageref": "page_5",
        "request": {
          "method": "GET",
          "url": "https://static.facebook.com/images/logos/facebook_2x.png",
          "httpVersion": "http/2.0",
          "headers": [
            {
              "name": "sec-ch-ua",
              "value": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\""
            },
            {
              "name": "Referer",
              "value": "https://code.facebook.com/"
            },
            {
              "name": "sec-ch-ua-mobile",
              "value": "?0"
            },
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
            },
            {
              "name": "sec-ch-ua-platform",
              "value": "\"Linux\""
            }
          ],
          "queryString": [],
          "cookies": [],
          "headersSize": -1,
          "bodySize": 0
        },
        "response": {
          "status": 200,
          "statusText": "",
          "httpVersion": "http/2.0",
          "headers": [
            {
              "name": "content-type",
              "value": "image/png"
            },
            {
              "name": "access-control-allow-origin",
              "value": "*"
            },
            {
              "name": "content-md5",
              "value": "yA8fgUWSfr02VB+1e786Qw=="
            },
            {
              "name": "edge-control",
              "value": "cache-maxage=86400s"
            },
            {
              "name": "expires",
              "value": "Fri, 29 Oct 2021 16:48:37 GMT"
            },
            {
              "name": "cache-control",
              "value": "public,max-age=86400"
            },
            {
              "name": "report-to",
              "value": "{\"max_age\":86400,\"endpoints\":[{\"url\":\"https:\\/\\/www.facebook.com\\/browser_reporting\\/?minimize=0\"}],\"group\":\"coep_report\"}"
            },
            {
              "name": "x-fb-rlafr",
              "value": "0"
            },
            {
              "name": "cross-origin-resource-policy",
              "value": "cross-origin"
            },
            {
              "name": "cross-origin-embedder-policy-report-only",
              "value": "require-corp;report-to=\"coep_report\""
            },
            {
              "name": "cross-origin-opener-policy",
              "value": "same-origin-allow-popups"
            },
            {
              "name": "x-content-type-options",
              "value": "nosniff"
            },
            {
              "name": "timing-allow-origin",
              "value": "*"
            },
            {
              "name": "x-fb-debug",
              "value": "82831ZFvHGbKRlzdLUSA56VOkcD3P/elztK5PO4lOnI++e7A6wOShKowaVugBwdP87Wbfw7tjsoXqTyvpdn83w=="
            },
            {
              "name": "content-length",
              "value": "479"
            },
            {
              "name": "date",
              "value": "Thu, 28 Oct 2021 16:48:37 GMT"
            },
            {
              "name": "priority",
              "value": "u=3,i"
            },
            {
              "name": "alt-svc",
              "value": "h3=\":443\"; ma=3600, h3-29=\":443\"; ma=3600,h3-27=\":443\"; ma=3600"
            }
          ],
          "cookies": [],
          "content": {
            "size": 479,
            "mimeType": "image/png",
            "text": "iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAn1BMVEUAAAA7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZg7WZh7x5p/AAAANHRSTlMAdx4R4bstvjvzTIRNON/G/t6LAvIhAW8T/Jh9qbkkbgvgm3Jmpdt2XJ/36lQc8Nwbo2oOEwdJKQAAALtJREFUeF7t0ccOwjAQRVFDEpxGGqn03jv+/29jsCUWIOSZlTfc3UhnMdJj1ELuCU0e95UNBKqAQb5AFgLmWMwB51icAxboDOFovljeB/3RLNHiw7HHVMzW4csVFBInXYbHDiPgCQWrL6aboQPtNXgs8Qo3SlviMwULY9i1ZGpqS3X7hTvsuzUBnwQBbyl4R8GRkVHM4z9usLgBnGJxCjjD4gxwbeOwXTOoiDE4LpisdKvWZw+J32fllgCfrscg5/MXMkQAAAAASUVORK5CYII=",
            "encoding": "base64"
          },
          "redirectURL": "",
          "headersSize": -1,
          "bodySize": 0,
          "_transferSize": 0,
          "_error": null
        },
        "serverIPAddress": "31.13.92.10",
        "startedDateTime": "2021-10-28T16:49:10.163Z",
        "time": 1.0409999995317776,
        "timings": {
          "blocked": 0.5919999979494606,
          "dns": -1,
          "ssl": -1,
          "connect": -1,
          "send": 0,
          "wait": 0.14500000053085388,
          "receive": 0.3040000010514632,
          "_blocked_queueing": 0.5419999979494605
        }
      },
      {
        "_initiator": {
          "type": "other"
        },
        "_priority": "High",
        "_resourceType": "other",
        "cache": {},
        "pageref": "page_5",
        "request": {
          "method": "GET",
          "url": "https://code.facebook.com/favicon.ico",
          "httpVersion": "",
          "headers": [
            {
              "name": "sec-ch-ua",
              "value": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\""
            },
            {
              "name": "Referer",
              "value": "https://code.facebook.com/github/callback?code=b72c8c84XxxxXXXXXXXx&state=AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX"
            },
            {
              "name": "sec-ch-ua-mobile",
              "value": "?0"
            },
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
            },
            {
              "name": "sec-ch-ua-platform",
              "value": "\"Linux\""
            }
          ],
          "queryString": [],
          "cookies": [],
          "headersSize": -1,
          "bodySize": 0
        },
        "response": {
          "status": 301,
          "statusText": "",
          "httpVersion": "",
          "headers": [
            {
              "name": "location",
              "value": "https://code.fb.com/favicon.ico"
            },
            {
              "name": "content-type",
              "value": "text/html; charset=\"utf-8\""
            },
            {
              "name": "x-fb-debug",
              "value": "fnGXyPzWgAFT3ReJgR90xW2FH+VMFcTvD0xs920nILOUQz1mlctivsITQy/NgUkAkOuAK6WycvWqKv9OtRstkw=="
            },
            {
              "name": "content-length",
              "value": "0"
            },
            {
              "name": "date",
              "value": "Thu, 28 Oct 2021 16:48:37 GMT"
            },
            {
              "name": "alt-svc",
              "value": "h3=\":443\"; ma=3600, h3-29=\":443\"; ma=3600,h3-27=\":443\"; ma=3600"
            },
            {
              "name": "priority",
              "value": "u=3,i"
            }
          ],
          "cookies": [],
          "content": {
            "size": 0,
            "mimeType": "x-unknown"
          },
          "redirectURL": "https://code.fb.com/favicon.ico",
          "headersSize": -1,
          "bodySize": -1,
          "_transferSize": 0,
          "_error": "net::ERR_ABORTED"
        },
        "serverIPAddress": "",
        "startedDateTime": "2021-10-28T16:49:10.259Z",
        "time": 1.962999998795567,
        "timings": {
          "blocked": 1.962999998795567,
          "dns": -1,
          "ssl": -1,
          "connect": -1,
          "send": 0,
          "wait": 0,
          "receive": 0,
          "_blocked_queueing": -1
        }
      },
      {
        "_initiator": {
          "type": "other"
        },
        "_priority": "VeryLow",
        "_resourceType": "other",
        "cache": {},
        "pageref": "page_5",
        "request": {
          "method": "POST",
          "url": "https://www.facebook.com/csp/reporting/?m=c&minimize=0",
          "httpVersion": "h3",
          "headers": [
            {
              "name": ":method",
              "value": "POST"
            },
            {
              "name": ":authority",
              "value": "www.facebook.com"
            },
            {
              "name": ":scheme",
              "value": "https"
            },
            {
              "name": ":path",
              "value": "/csp/reporting/?m=c&minimize=0"
            },
            {
              "name": "content-length",
              "value": "1617"
            },
            {
              "name": "sec-ch-ua",
              "value": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\""
            },
            {
              "name": "sec-ch-ua-mobile",
              "value": "?0"
            },
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
            },
            {
              "name": "sec-ch-ua-platform",
              "value": "\"Linux\""
            },
            {
              "name": "content-type",
              "value": "application/csp-report"
            },
            {
              "name": "accept",
              "value": "*/*"
            },
            {
              "name": "origin",
              "value": "https://code.facebook.com"
            },
            {
              "name": "sec-fetch-site",
              "value": "same-site"
            },
            {
              "name": "sec-fetch-mode",
              "value": "no-cors"
            },
            {
              "name": "sec-fetch-dest",
              "value": "report"
            },
            {
              "name": "referer",
              "value": "https://code.facebook.com/"
            },
            {
              "name": "accept-encoding",
              "value": "gzip, deflate, br"
            },
            {
              "name": "accept-language",
              "value": "en-US,en;q=0.9"
            }
          ],
          "queryString": [
            {
              "name": "m",
              "value": "c"
            },
            {
              "name": "minimize",
              "value": "0"
            }
          ],
          "cookies": [],
          "headersSize": -1,
          "bodySize": 1617,
          "postData": {
            "mimeType": "application/csp-report",
            "text": "{\"csp-report\":{\"document-uri\":\"https://code.facebook.com/github/callback?code=b72c8c84XxxxXXXXXXXx&state=AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX\",\"referrer\":\"https://github.com/\",\"violated-directive\":\"img-src\",\"effective-directive\":\"img-src\",\"original-policy\":\"default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;\",\"disposition\":\"report\",\"blocked-uri\":\"https://code.facebook.com/favicon.ico\",\"status-code\":500,\"script-sample\":\"\"}}"
          }
        },
        "response": {
          "status": 200,
          "statusText": "",
          "httpVersion": "h3",
          "headers": [
            {
              "name": "report-to",
              "value": "{\"max_age\":86400,\"endpoints\":[{\"url\":\"https:\\/\\/www.facebook.com\\/browser_reporting\\/?minimize=0\"}],\"group\":\"coep_report\"}"
            },
            {
              "name": "x-fb-rlafr",
              "value": "0"
            },
            {
              "name": "cross-origin-embedder-policy-report-only",
              "value": "require-corp;report-to=\"coep_report\""
            },
            {
              "name": "cross-origin-opener-policy",
              "value": "same-origin-allow-popups"
            },
            {
              "name": "pragma",
              "value": "no-cache"
            },
            {
              "name": "cache-control",
              "value": "private, no-cache, no-store, must-revalidate"
            },
            {
              "name": "expires",
              "value": "Sat, 01 Jan 2000 00:00:00 GMT"
            },
            {
              "name": "x-content-type-options",
              "value": "nosniff"
            },
            {
              "name": "x-xss-protection",
              "value": "0"
            },
            {
              "name": "content-security-policy-report-only",
              "value": "default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;"
            },
            {
              "name": "content-security-policy",
              "value": "default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;block-all-mixed-content;upgrade-insecure-requests;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;"
            },
            {
              "name": "x-frame-options",
              "value": "DENY"
            },
            {
              "name": "strict-transport-security",
              "value": "max-age=15552000; preload"
            },
            {
              "name": "content-type",
              "value": "text/html; charset=\"utf-8\""
            },
            {
              "name": "x-fb-debug",
              "value": "eat0jdJo3wmSz6SluJOxhNTVKhPWXtRly5RKKhNhsGowYC9QnmQPQ+3bMfIs0IBQsGcphYllMHsW0TANndxHhA=="
            },
            {
              "name": "content-length",
              "value": "0"
            },
            {
              "name": "date",
              "value": "Thu, 28 Oct 2021 16:49:10 GMT"
            },
            {
              "name": "priority",
              "value": "u=3,i"
            },
            {
              "name": "alt-svc",
              "value": "h3=\":443\"; ma=3600, h3-29=\":443\"; ma=3600,h3-27=\":443\"; ma=3600"
            }
          ],
          "cookies": [],
          "content": {
            "size": 0,
            "mimeType": "text/html",
            "text": ""
          },
          "redirectURL": "",
          "headersSize": -1,
          "bodySize": -1,
          "_transferSize": 0,
          "_error": null
        },
        "serverIPAddress": "157.240.196.35",
        "startedDateTime": "2021-10-28T16:49:10.261Z",
        "time": 118.30299999928684,
        "timings": {
          "blocked": 0.5390000008090865,
          "dns": -1,
          "ssl": -1,
          "connect": -1,
          "send": 0.16699999999999998,
          "wait": 116.91299999974994,
          "receive": 0.6839999987278134,
          "_blocked_queueing": 0.4000000008090865
        }
      },
      {
        "_initiator": {
          "type": "other"
        },
        "_priority": "VeryLow",
        "_resourceType": "other",
        "cache": {},
        "pageref": "page_5",
        "request": {
          "method": "POST",
          "url": "https://www.facebook.com/csp/reporting/?m=c&minimize=0",
          "httpVersion": "h3",
          "headers": [
            {
              "name": ":method",
              "value": "POST"
            },
            {
              "name": ":authority",
              "value": "www.facebook.com"
            },
            {
              "name": ":scheme",
              "value": "https"
            },
            {
              "name": ":path",
              "value": "/csp/reporting/?m=c&minimize=0"
            },
            {
              "name": "content-length",
              "value": "1668"
            },
            {
              "name": "sec-ch-ua",
              "value": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\""
            },
            {
              "name": "sec-ch-ua-mobile",
              "value": "?0"
            },
            {
              "name": "user-agent",
              "value": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
            },
            {
              "name": "sec-ch-ua-platform",
              "value": "\"Linux\""
            },
            {
              "name": "content-type",
              "value": "application/csp-report"
            },
            {
              "name": "accept",
              "value": "*/*"
            },
            {
              "name": "origin",
              "value": "https://code.facebook.com"
            },
            {
              "name": "sec-fetch-site",
              "value": "same-site"
            },
            {
              "name": "sec-fetch-mode",
              "value": "no-cors"
            },
            {
              "name": "sec-fetch-dest",
              "value": "report"
            },
            {
              "name": "referer",
              "value": "https://code.facebook.com/"
            },
            {
              "name": "accept-encoding",
              "value": "gzip, deflate, br"
            },
            {
              "name": "accept-language",
              "value": "en-US,en;q=0.9"
            }
          ],
          "queryString": [
            {
              "name": "m",
              "value": "c"
            },
            {
              "name": "minimize",
              "value": "0"
            }
          ],
          "cookies": [],
          "headersSize": -1,
          "bodySize": 1668,
          "postData": {
            "mimeType": "application/csp-report",
            "text": "{\"csp-report\":{\"document-uri\":\"https://code.facebook.com/github/callback?code=b72c8c84XxxxXXXXXXXx&state=AVHDMk3LXX-xxXXxXXXXxxXxXxXxXxXxXXxxxxxXXXxxXXXxxXxxxxxXX-XxXxXXXxXXxXXXxxxXxXxXxXxXXXXXX_XXxXXxXXXxXxXXXxXxxXXxx-xXxxXXxXxxXxXXXxxXX-XxXxX-XXXXxxXXxxxXx_xxXXxxxxXXXxXxXXXXXxXXxXXXXxxxXxXXXxXXXxXXXXXXXxxXXXXXxXX-XxxXXXXXXXXxxXXxXxXXxxxXXxxXxXxXXXxxXXxXXXxXXxxxXXX-XxXx_XxXXxxxXxXX\",\"referrer\":\"https://github.com/\",\"violated-directive\":\"img-src\",\"effective-directive\":\"img-src\",\"original-policy\":\"default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;block-all-mixed-content;upgrade-insecure-requests;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;\",\"disposition\":\"enforce\",\"blocked-uri\":\"https://code.facebook.com/favicon.ico\",\"status-code\":500,\"script-sample\":\"\"}}"
          }
        },
        "response": {
          "status": 200,
          "statusText": "",
          "httpVersion": "h3",
          "headers": [
            {
              "name": "report-to",
              "value": "{\"max_age\":86400,\"endpoints\":[{\"url\":\"https:\\/\\/www.facebook.com\\/browser_reporting\\/?minimize=0\"}],\"group\":\"coep_report\"}"
            },
            {
              "name": "x-fb-rlafr",
              "value": "0"
            },
            {
              "name": "cross-origin-embedder-policy-report-only",
              "value": "require-corp;report-to=\"coep_report\""
            },
            {
              "name": "cross-origin-opener-policy",
              "value": "same-origin-allow-popups"
            },
            {
              "name": "pragma",
              "value": "no-cache"
            },
            {
              "name": "cache-control",
              "value": "private, no-cache, no-store, must-revalidate"
            },
            {
              "name": "expires",
              "value": "Sat, 01 Jan 2000 00:00:00 GMT"
            },
            {
              "name": "x-content-type-options",
              "value": "nosniff"
            },
            {
              "name": "x-xss-protection",
              "value": "0"
            },
            {
              "name": "content-security-policy-report-only",
              "value": "default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;"
            },
            {
              "name": "content-security-policy",
              "value": "default-src data: blob: 'self' https://*.fbsbx.com 'unsafe-inline' *.facebook.com 'unsafe-eval' *.fbcdn.net;script-src *.facebook.com *.fbcdn.net 'unsafe-inline' 'unsafe-eval' blob: data: 'self';style-src *.fbcdn.net data: *.facebook.com 'unsafe-inline';connect-src *.facebook.com facebook.com *.fbcdn.net wss://*.facebook.com:* attachment.fbsbx.com blob: *.cdninstagram.com 'self' wss://gateway.facebook.com wss://edge-chat.facebook.com wss://snaptu-d.facebook.com wss://kaios-d-test.facebook.com/ wss://kaios-d.facebook.com/ *.fbsbx.com;font-src data: *.facebook.com *.fbcdn.net *.fbsbx.com;img-src *.fbcdn.net *.facebook.com data: https://*.fbsbx.com facebook.com *.cdninstagram.com fbsbx.com fbcdn.net blob: android-webview-video-poster:;media-src *.cdninstagram.com blob: *.fbcdn.net *.fbsbx.com www.facebook.com *.facebook.com data:;frame-src *.facebook.com *.fbsbx.com data: *.fbcdn.net;worker-src blob: *.facebook.com data:;block-all-mixed-content;upgrade-insecure-requests;report-uri https://www.facebook.com/csp/reporting/?m=c&minimize=0;"
            },
            {
              "name": "x-frame-options",
              "value": "DENY"
            },
            {
              "name": "strict-transport-security",
              "value": "max-age=15552000; preload"
            },
            {
              "name": "content-type",
              "value": "text/html; charset=\"utf-8\""
            },
            {
              "name": "x-fb-debug",
              "value": "mIki4e3hvMyjKBnNCF3TSE87OS1/4i0TotiiU3L3CiU3a6bRrptfhmpXVItmgVAYoy4Rsi4oPAXH1BGIkm4/Uw=="
            },
            {
              "name": "content-length",
              "value": "0"
            },
            {
              "name": "date",
              "value": "Thu, 28 Oct 2021 16:49:10 GMT"
            },
            {
              "name": "alt-svc",
              "value": "h3=\":443\"; ma=3600, h3-29=\":443\"; ma=3600,h3-27=\":443\"; ma=3600"
            },
            {
              "name": "priority",
              "value": "u=3,i"
            }
          ],
          "cookies": [],
          "content": {
            "size": 0,
            "mimeType": "text/html",
            "text": ""
          },
          "redirectURL": "",
          "headersSize": -1,
          "bodySize": -1,
          "_transferSize": 0,
          "_error": null
        },
        "serverIPAddress": "157.240.196.35",
        "startedDateTime": "2021-10-28T16:49:10.261Z",
        "time": 124.8539999978675,
        "timings": {
          "blocked": 1.2719999985315371,
          "dns": -1,
          "ssl": -1,
          "connect": -1,
          "send": 0.117,
          "wait": 122.95300000062865,
          "receive": 0.5119999987073243,
          "_blocked_queueing": 1.1669999985315371
        }
      }
    ]
  }
}

@blefaudeux
Copy link
Contributor

Unfortunately, I still can't sign the CLA. In both Firefox (private and non-private) and Chrome (fresh installation), I get a 500 when it redirects me from GitHub to the callback URL.

Response HAR

I've asked about that internally, getting back to you asap

@ClashLuke
Copy link
Contributor Author

Thank you very much! I'm looking forward to resolving this.

@ClashLuke
Copy link
Contributor Author

I also did some more testing of RevLib compared to your existing solution. It seems ReversibleHalfResidualAndSwap is significantly slower than computing the whole reversible block in one go, which is likely because of PyTorch-internal overheads. (At HomebrewNLP, we found that putting an entire transformer block into a single scripted function with many inputs is usually >10% faster than the baseline.)

Upstream

 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.88                |14.42               |114.69              |3.36                |26.40               |210.58              |37.90               |304.27              |2429.77             |
|reversible - fw+bw                              |2.89                |20.98               |165.43              |4.99                |37.71               |299.12              |49.22               |389.86              |3107.68             |


=======================

Proposed:

 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.88                |14.43               |115.08              |3.37                |26.37               |210.46              |38.07               |304.33              |2428.43             |
|reversible - fw+bw                              |2.90                |21.01               |165.99              |4.98                |37.68               |299.16              |49.25               |390.38              |3109.14             |


=======================

RevLib - Autograd Graph

 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.88                |14.40               |114.82              |3.37                |26.41               |210.35              |38.20               |305.53              |2440.78             |
|reversible - fw+bw                              |3.23                |27.84               |186.43              |5.32                |40.25               |319.73              |49.63               |397.07              |3171.01             |


=======================

RevLib - Autograd Function

 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.88                |14.43               |114.64              |3.37                |26.38               |210.30              |38.12               |303.63              |2434.23             |
|reversible - fw+bw                              |3.22                |25.03               |186.12              |5.32                |40.28               |319.78              |49.94               |392.84              |3156.77             |

@blefaudeux
Copy link
Contributor

Thank you very much! I'm looking forward to resolving this.

it's being fixed, know issue with a service being down it seems, I'll keep you posted

@blefaudeux
Copy link
Contributor

(At HomebrewNLP, we found that putting an entire transformer block into a single scripted function with many inputs is usually >10% faster than the baseline.)

Ah, this could be that some cuda calls are fused, but typically I think that torch.jit is very limited in the ops it can fused really, which limits the benefits

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2021
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

1 similar comment
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@dianaml0 dianaml0 left a comment

Choose a reason for hiding this comment

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

Thanks a lot @ClashLuke for your contribution and for testing out the impact of these changes to reversible layers! The benchmark is a really great addition! It seems like removing the cat and chunk operations didn't have the expected speed up for some reason - perhaps we can merge in the benchmarking code but leave reversible.py as it was for the sake of simplicity?

@ClashLuke
Copy link
Contributor Author

ClashLuke commented Oct 29, 2021

I just gave it a try on a rented A100, and it seems like the speedup is negligible, especially for large batch sizes. If you find the original code simpler, let's revert.

Batch * Sequence in (16ki, 2ki, 128)
Upstream:

 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |0.17                |2.61                |33.81               |0.16                |4.15                |30.77               |0.42                |3.25                |32.05               |
|reversible - fw                                 |0.27                |6.52                |56.69               |0.39                |5.55                |52.31               |0.44                |6.79                |56.95               |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |0.17                |2.41                |29.93               |0.18                |2.51                |28.32               |0.76                |6.01                |47.60               |
|reversible - fw                                 |0.18                |5.97                |42.80               |0.19                |6.34                |41.91               |0.78                |6.08                |47.86               |


 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.47                |10.97               |115.48              |0.94                |14.53               |194.51              |2.16                |14.96               |119.33              |
|reversible - fw+bw                              |3.91                |31.17               |225.91              |3.06                |35.75               |241.17              |3.47                |32.27               |217.62              |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.31                |11.86               |78.94               |0.76                |13.88               |87.93               |3.71                |26.66               |212.21              |
|reversible - fw+bw                              |3.60                |28.95               |230.99              |3.11                |24.63               |216.43              |4.22                |33.24               |264.72              |

========================

Proposed:

 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |0.17                |3.62                |26.28               |0.16                |3.91                |33.23               |0.42                |3.74                |31.64               |
|reversible - fw                                 |0.15                |4.90                |44.41               |0.37                |7.11                |49.51               |0.44                |5.00                |44.59               |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |0.16                |3.36                |34.08               |0.17                |3.42                |27.66               |0.76                |6.00                |47.43               |
|reversible - fw                                 |0.18                |4.47                |48.93               |0.19                |6.34                |43.61               |0.78                |6.76                |47.71               |


 --- Type: torch.float16 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.38                |10.50               |89.10               |0.69                |10.65               |100.32              |2.15                |15.35               |118.91              |
|reversible - fw+bw                              |3.54                |30.13               |209.89              |4.43                |31.94               |238.64              |3.86                |33.39               |263.07              |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=16384, Features=32, Depth=4|Batch=16384, Features=32, Depth=32|Batch=16384, Features=32, Depth=256|Batch=2048, Features=256, Depth=4|Batch=2048, Features=256, Depth=32|Batch=2048, Features=256, Depth=256|Batch=128, Features=4096, Depth=4|Batch=128, Features=4096, Depth=32|Batch=128, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |1.26                |11.99               |103.16              |1.21                |12.06               |84.13               |3.59                |26.60               |212.19              |
|reversible - fw+bw                              |3.62                |28.10               |189.94              |3.61                |29.38               |201.67              |4.49                |33.17               |264.14              |
Batch * Sequence in (512ki, 64ki, 4ki)
Upstream:

 --- Type: torch.float16 ---
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |1.85                |13.82               |110.34              |1.78                |14.24               |113.61              |5.65                |45.17               |347.51              |
|reversible - fw                                 |1.94                |14.03               |110.63              |1.99                |14.47               |113.81              |5.92                |45.78               |348.78              |


 --- Type: torch.float32 ---
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |3.08                |24.62               |196.90              |3.06                |24.54               |196.16              |10.57               |85.51               |671.90              |
|reversible - fw                                 |3.41                |24.96               |197.29              |3.40                |24.87               |196.55              |10.91               |85.82               |677.07              |


 --- Type: torch.float16 ---
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |4.08                |31.18               |247.70              |4.42                |33.99               |270.20              |16.37               |123.36              |965.07              |
|reversible - fw+bw                              |6.37                |45.73               |360.55              |6.72                |48.81               |385.56              |22.70               |167.17              |1306.73             |


 --- Type: torch.float32 ---
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |7.33                |56.22               |448.13              |7.74                |59.61               |474.78              |31.30               |255.06              |1924.65             |
|reversible - fw+bw                              |11.27               |81.70               |646.12              |11.68               |85.28               |673.13              |42.79               |338.19              |2561.36             |


=====================

Proposed:

 --- Type: torch.float16 ---
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |1.97                |13.82               |110.45              |1.78                |14.24               |113.69              |5.65                |44.96               |347.49              |
|reversible - fw                                 |1.94                |14.04               |110.56              |1.99                |14.46               |114.05              |5.94                |45.98               |350.02              |


 --- Type: torch.float32 ---
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw                                   |3.08                |24.63               |197.04              |3.07                |24.56               |196.38              |10.56               |85.49               |672.41              |
|reversible - fw                                 |3.41                |24.97               |197.30              |3.40                |24.88               |196.73              |10.91               |85.81               |677.29              |


 --- Type: torch.float16 ---
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |4.08                |31.24               |247.76              |4.42                |33.96               |270.01              |16.33               |123.62              |965.01              |
|reversible - fw+bw                              |6.37                |45.68               |360.07              |6.73                |48.79               |385.51              |22.82               |168.32              |1307.25             |


 --- Type: torch.float32 --- 
| Units: runtime in ms, lower is better          |Batch=524288, Features=32, Depth=4|Batch=524288, Features=32, Depth=32|Batch=524288, Features=32, Depth=256|Batch=65536, Features=256, Depth=4|Batch=65536, Features=256, Depth=32|Batch=65536, Features=256, Depth=256|Batch=4096, Features=4096, Depth=4|Batch=4096, Features=4096, Depth=32|Batch=4096, Features=4096, Depth=256|
|------------------------------------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|
|residual - fw+bw                                |7.34                |56.26               |448.10              |7.75                |59.73               |475.17              |31.35               |254.32              |1925.63             |
|reversible - fw+bw                              |11.29               |81.75               |646.46              |11.68               |85.38               |673.95              |42.83               |339.35              |2561.78             |

@ClashLuke ClashLuke changed the title perf(revnet): remove/fuse cat-split [feat] add split_dim arg to reversible, remove retain_grad, add benchmark_reversible Oct 29, 2021
@blefaudeux
Copy link
Contributor

@ClashLuke thanks for the changes and sorry for the broken test, should be fixed now if you rebase onto main :/ really sorry about the experience

Copy link
Contributor

@blefaudeux blefaudeux left a comment

Choose a reason for hiding this comment

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

Looks great to me, thanks again @ClashLuke !

Copy link
Contributor

@dianaml0 dianaml0 left a comment

Choose a reason for hiding this comment

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

Looks great!

@dianaml0 dianaml0 merged commit 0ae331a into facebookresearch:main Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants