CARVIEW |
Select Language
HTTP/2 200
date: Mon, 21 Jul 2025 16:36:45 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/pytorch/pytorch.git
etag: W/"6c90722f1805147b4d9beb1aefde4d8f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=NLd0WOATtJTZUIWtFq1JFivr9qvmKokTLPh2mABzxMkOxy1r950LqJDBsY7tgnMNqxyAwe6y3k0no06NCINbLq7IwqetuoLm6%2BWZowcd4u1kG4cRbiaCsC3MaiCFhTpSwTTS%2ByYGPd%2Flc225p%2BGdaEXd6wc6cuOzN6K5%2FRAQbCQLlXPEOBR6MlOHgge0yW0z%2BUTmls5wr6YS4w6ltawIsRCyIXm%2FoC%2FphtWWo%2F%2Fzye85Swd5q2DfMVaRYyU9d%2FimYuhNjINUJGQ2ZfczM3ZyHA%3D%3D--xFwSDw2nHWh0nmg6--ns%2Bed%2BnSYSiqV4pgisTqJA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.779094353.1753115804; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 16:36:44 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 21 Jul 2026 16:36:44 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: AAC6:2AFEEF:119788:14A5EC:687E6C9C
NJT binary pointwise broadcasting support via jagged <-> padded dense… · pytorch/pytorch@888744b · GitHub
Copy file name to clipboardExpand all lines: torch/nested/_internal/ops.py
Copy file name to clipboardExpand all lines: torch/testing/_internal/opinfo/definitions/nested.py
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Commit 888744b
NJT binary pointwise broadcasting support via jagged <-> padded dense conversion (#133021)
Related: #132695
This PR uses padded dense <-> jagged conversions to handle binary pointwise broadcasting of (NT, T) and (T, NT). This includes:
* `(B, j0, D) + (1, 1, 1)`
* `(B, j0, D) + (B, 1, 1)`
* `(B, j0, D) + (B, 1, D)`
* etc.
This PR also adds (hacky) support for bool inputs to the jagged <-> padded dense conversions. The underlying CUDA kernels do not support integer / bool inputs; so the following workaround is employed: `convert input -> half, run conversion kernel, convert output -> bool`. Note that this bool support is needed specifically for the backward formula of `fmax`, and likely others.
Pull Request resolved: #133021
Approved by: https://github.com/cpuhrsch1 parent 8ecc5f1 commit 888744bCopy full SHA for 888744b
File tree
Expand file treeCollapse file tree
3 files changed
+181
-30
lines changedFilter options
- test
- torch
- nested/_internal
- testing/_internal/opinfo/definitions
Expand file treeCollapse file tree
3 files changed
+181
-30
lines changed+16-7Lines changed: 16 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7185 | 7185 |
| |
7186 | 7186 |
| |
7187 | 7187 |
| |
7188 |
| - | |
| 7188 | + | |
7189 | 7189 |
| |
7190 | 7190 |
| |
7191 | 7191 |
| |
| 7192 | + | |
| 7193 | + | |
| 7194 | + | |
| 7195 | + | |
7192 | 7196 |
| |
7193 | 7197 |
| |
7194 | 7198 |
| |
| |||
7198 | 7202 |
| |
7199 | 7203 |
| |
7200 | 7204 |
| |
7201 |
| - | |
| 7205 | + | |
| 7206 | + | |
| 7207 | + | |
7202 | 7208 |
| |
7203 | 7209 |
| |
7204 | 7210 |
| |
| |||
7219 | 7225 |
| |
7220 | 7226 |
| |
7221 | 7227 |
| |
7222 |
| - | |
| 7228 | + | |
7223 | 7229 |
| |
7224 | 7230 |
| |
7225 | 7231 |
| |
| |||
7234 | 7240 |
| |
7235 | 7241 |
| |
7236 | 7242 |
| |
| 7243 | + | |
| 7244 | + | |
| 7245 | + | |
| 7246 | + | |
7237 | 7247 |
| |
7238 | 7248 |
| |
7239 | 7249 |
| |
| |||
7243 | 7253 |
| |
7244 | 7254 |
| |
7245 | 7255 |
| |
7246 |
| - | |
| 7256 | + | |
| 7257 | + | |
| 7258 | + | |
7247 | 7259 |
| |
7248 | 7260 |
| |
7249 | 7261 |
| |
| |||
7469 | 7481 |
| |
7470 | 7482 |
| |
7471 | 7483 |
| |
7472 |
| - | |
7473 |
| - | |
7474 |
| - | |
7475 | 7484 |
| |
7476 | 7485 |
| |
7477 | 7486 |
| |
|
torch/nested/_internal/ops.py
Copy file name to clipboardExpand all lines: torch/nested/_internal/ops.py+78-13Lines changed: 78 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
283 | 283 |
| |
284 | 284 |
| |
285 | 285 |
| |
286 |
| - | |
287 |
| - | |
| 286 | + | |
288 | 287 |
| |
289 | 288 |
| |
290 | 289 |
| |
| |||
294 | 293 |
| |
295 | 294 |
| |
296 | 295 |
| |
297 |
| - | |
298 |
| - | |
299 |
| - | |
300 |
| - | |
301 |
| - | |
302 |
| - | |
303 |
| - | |
304 |
| - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
305 | 329 |
| |
306 | 330 |
| |
307 | 331 |
| |
| |||
1106 | 1130 |
| |
1107 | 1131 |
| |
1108 | 1132 |
| |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1109 | 1137 |
| |
1110 | 1138 |
| |
1111 | 1139 |
| |
1112 |
| - | |
| 1140 | + | |
1113 | 1141 |
| |
1114 | 1142 |
| |
1115 | 1143 |
| |
1116 | 1144 |
| |
1117 |
| - | |
| 1145 | + | |
1118 | 1146 |
| |
1119 | 1147 |
| |
1120 | 1148 |
| |
| |||
1396 | 1424 |
| |
1397 | 1425 |
| |
1398 | 1426 |
| |
1399 |
| - | |
| 1427 | + | |
1400 | 1428 |
| |
1401 | 1429 |
| |
1402 | 1430 |
| |
| |||
1412 | 1440 |
| |
1413 | 1441 |
| |
1414 | 1442 |
| |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
1415 | 1448 |
| |
1416 | 1449 |
| |
1417 | 1450 |
| |
| |||
1617 | 1650 |
| |
1618 | 1651 |
| |
1619 | 1652 |
| |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
1620 | 1658 |
| |
1621 | 1659 |
| |
1622 | 1660 |
| |
1623 | 1661 |
| |
1624 | 1662 |
| |
1625 | 1663 |
| |
| 1664 | + | |
| 1665 | + | |
1626 | 1666 |
| |
1627 | 1667 |
| |
1628 | 1668 |
| |
| |||
1656 | 1696 |
| |
1657 | 1697 |
| |
1658 | 1698 |
| |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1659 | 1704 |
| |
1660 | 1705 |
| |
1661 | 1706 |
| |
| 1707 | + | |
| 1708 | + | |
1662 | 1709 |
| |
1663 | 1710 |
| |
1664 | 1711 |
| |
| |||
1791 | 1838 |
| |
1792 | 1839 |
| |
1793 | 1840 |
| |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1794 | 1859 |
| |
1795 | 1860 |
| |
1796 | 1861 |
| |
|
torch/testing/_internal/opinfo/definitions/nested.py
Copy file name to clipboardExpand all lines: torch/testing/_internal/opinfo/definitions/nested.py+87-10Lines changed: 87 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
79 |
| - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 |
| |
81 |
| - | |
| 88 | + | |
82 | 89 |
| |
83 |
| - | |
| 90 | + | |
84 | 91 |
| |
85 |
| - | |
| 92 | + | |
86 | 93 |
| |
87 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
88 | 102 |
| |
89 | 103 |
| |
90 | 104 |
| |
91 |
| - | |
92 |
| - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
93 | 108 |
| |
94 | 109 |
| |
95 | 110 |
| |
96 | 111 |
| |
97 | 112 |
| |
98 |
| - | |
| 113 | + | |
99 | 114 |
| |
100 | 115 |
| |
101 | 116 |
| |
102 | 117 |
| |
103 | 118 |
| |
104 |
| - | |
| 119 | + | |
105 | 120 |
| |
106 | 121 |
| |
107 | 122 |
| |
| |||
157 | 172 |
| |
158 | 173 |
| |
159 | 174 |
| |
160 |
| - | |
161 | 175 |
| |
162 | 176 |
| |
163 | 177 |
| |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
164 | 241 |
| |
165 | 242 |
| |
166 | 243 |
| |
| |||
311 | 388 |
| |
312 | 389 |
| |
313 | 390 |
| |
314 |
| - | |
| 391 | + | |
315 | 392 |
| |
316 | 393 |
| |
317 | 394 |
| |
|
You can’t perform that action at this time.
0 commit comments