This file contains 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
""" | |
""" | |
from typing import Type, Tuple, Union | |
from functools import reduce | |
Scalar = Union[int, float] | |
ScalarType = Union[Type[int], Type[float]] | |
class Array: |
This file contains 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
import sys | |
import timeit | |
from functools import partial, reduce | |
from itertools import product | |
from typing import Optional, Union | |
import torch | |
from torch._inductor.compile_fx import compile_fx_inner, cudagraphify_impl, compile_fx | |
from torch._inductor.decomposition import decompositions | |
from torch.fx.experimental.proxy_tensor import make_fx |
This file contains 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
import math | |
import torch | |
import triton | |
import triton.language as tl | |
from typing import Optional, Tuple | |
def _has_triton(): | |
if not torch.cuda.is_available(): |
This file contains 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
import torch | |
import torch._dynamo as torchdynamo | |
torchdynamo.config.verbose = True | |
torchdynamo.config.suppress_errors = True | |
class TestCasePlaceholder: | |
def assertTrue(self, v): | |
assert v, "Expected True" |
This file contains 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
""" | |
Prior to adding the checks which error out when to_dense is called with hybrid (having dense dims) tensors | |
all of these examples triggered a segfault | |
The commented out lines trigger the error now, previously segfault | |
""" | |
import torch | |
dense = torch.randn(3, 4, dtype=torch.float32) | |
dense = dense * dense.relu().bool() | |
csr = dense.to_sparse_csr() |
This file contains 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
def _array_from_fchk(fchk_text, array_name): | |
# matches a line that looks like: | |
# {array_name} R N= {number of elements in array} | |
matcher = re.compile(r'\A(?P<title>{})\s+R\s+N=\s+(?P<nele>\d+)\Z'.format(array_name)) | |
fchk_lines = fchk_text.split('\n') | |
start_line = 0 | |
nline = 0 | |
found_match = False | |
for i, line in enumerate(fchk_lines): | |
# see if the line matches the regex |
This file contains 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
Memory used after allocating lg_array: 800 | |
Memory used after creating sm_vector: 840 | |
sm_vector = [ 0, 1, 2, 3, 4,] | |
sm_vector (after modify) = [ 100, 101, 102, 103, 104,] | |
First 5 elements of the original lg_array = [ 0, 1, 2, 3, 4,] | |
size of allocation lg_array: 800 | |
size of allocation sm_vector.data(): 40 |
This file contains 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
// I ran though this quick and expanded my useless comments with everything I could remember about this | |
// it was 2 years ago when I first wrote this. | |
// Some of it might be obvious to you, or just wrong, and I apologize but these ~200 lines are just about all of the js | |
// I have written in my life. Hope it helps! | |
google.maps.event.addDomListener(window, 'load', init); | |
var map; | |
var infowindow = null; | |
function init() { | |
//googlemaps api docs can explain what each option does |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.