This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Trying to use graphQL to fetch all commits associated with PR https://github.com/pytorch/pytorch/pull/77471 | |
# Expect to get 700+ commits for for some reason pagination ends after first 250 | |
# Needs valid PAT passed via GITHUB_TOKEN environment variable | |
GH_GET_COMMITS = """ | |
query($cursor: String) { | |
repository(owner: "pytorch", name: "pytorch") { | |
pullRequest(number: 77471) { | |
commits(first: 100, after: $cursor) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
repository(name: "pytorch", owner: "pytorch") { | |
object(oid: "7dd08230117f4fa8bb82b3524e90fb00340198c7") { | |
... on Commit { | |
checkSuites(first: 100, filterBy: {appId: 15368}) { | |
nodes { | |
workflowRun { | |
workflow { | |
name | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query { | |
repository(owner: "pytorch", name: "pytorch") { | |
pullRequest(number: 68111) { | |
closed | |
isCrossRepository | |
author { | |
login | |
} | |
title | |
body |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Author of https://github.com/pytorch/pytorch/pull/71735 is me (malfet) | |
# And if executed with my PAT it will return my association as "MEMBER" | |
# But if executed by somebody outside of org, it will say that association is "CONTRIBUTOR" | |
# Instead of getting PAT, one can simply execute the query at https://docs.github.com/en/graphql/overview/explorer | |
GH_GET_ASSOCIATION = """ | |
query { | |
repository(owner: "pytorch", name: "pytorch") { | |
pullRequest(number: 71735) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Print default branch for public repos in pytorch org | |
# Requires github token | |
from typing import Any, Dict | |
GH_SEARCH_REPO_REQ = """ | |
query($cursor: String) { | |
search(type: REPOSITORY, query: "org:pytorch", first: 100, after: $cursor) { | |
nodes { | |
... on Repository { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% curl -L https://github.com/pytorch/pytorch/pull/69840.patch|diffstat | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 143 100 143 0 0 459 0 --:--:-- --:--:-- --:--:-- 468 | |
100 7148 0 7148 0 0 11172 0 --:--:-- --:--:-- --:--:-- 11172 | |
aten/src/ATen/templates/RegisterBackendSelect.cpp | 27 ++++++++++++++------------- | |
aten/src/ATen/templates/RegisterSchema.cpp | 16 +--------------- | |
tools/codegen/gen.py | 40 +++++++++++++++++++++++----------------- | |
3 files changed, 38 insertions(+), 45 deletions(-) | |
% curl -L https://github.com/pytorch/pytorch/pull/69840.diff|diffstat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
from subprocess import check_output | |
def get_pmem(): | |
pmem = check_output(["sh", "-c", f"pmap -d {os.getpid()}|tail -n 1"], encoding="latin1").split()[3] | |
return pmem | |
def get_gpumem(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
__global__ void kernel() { | |
printf("Hello World of CUDA %d\n", threadIdx.x); | |
} | |
int main() { | |
kernel<<<1,1>>>(); | |
return cudaDeviceSynchronize(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL `resources/fonts/dejavu.css' | |
Parent URL file:///home/nshulga/git/pytorch.github.io/javadoc/stylesheet.css, line 3, col 12 | |
Real URL file:///home/nshulga/git/pytorch.github.io/javadoc/resources/fonts/dejavu.css | |
Result Error: URLError: <urlopen error [Errno 2] No such file or directory: '/home/nshulga/git/pytorch.github.io/javadoc/resources/fonts/dejavu.css'> | |
URL `../fonts/FreightSans/freight-sans-bold.woff' | |
Parent URL file:///home/nshulga/git/pytorch.github.io/assets/main.css, line 1, col 147264 | |
Real URL file:///home/nshulga/git/pytorch.github.io/fonts/FreightSans/freight-sans-bold.woff | |
Result Error: URLError: <urlopen error [Errno 2] No such file or directory: '/home/nshulga/git/pytorch.github.io/fonts/FreightSans/freight-sans-bold.woff'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
template<typename T> | |
struct WhatsMyName { | |
WhatsMyName() { | |
std::cout << __PRETTY_FUNCTION__ << std::endl; | |
} | |
}; |