Skip to content

Instantly share code, notes, and snippets.

View isVoid's full-sized avatar
🤗

Michael Wang isVoid

🤗
View GitHub Profile
@isVoid
isVoid / CMakeLists.txt
Last active April 8, 2024 15:18
Trace Instantiated Class Template from ParmVarDecl
cmake_minimum_required(VERSION 3.10)
project(ClangToolingExample)
# libastcanopy shared lib targget
find_package(Clang REQUIRED)
# Add include directories
include_directories(${CLANG_INCLUDE_DIRS})
# Add the source files for your Clang tool
@isVoid
isVoid / module_scraper.py
Created March 7, 2024 10:04
Recursively extract module and functions
import os
import pkgutil
import importlib
from inspect import getmembers, isfunction
import cuml
import json
import pprint
pp = pprint.PrettyPrinter(indent=4)
@isVoid
isVoid / tf_device_bug.ipynb
Last active September 19, 2023 10:17
Several Repros of `tf.device` bug, ran on Nvidia DGX V100 machines with 8GPUs.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@isVoid
isVoid / benchmark_driver.py
Last active May 31, 2023 15:59
Pairwise LineString DIstance Benchmarks
from dataclasses import dataclass
import subprocess
benchmark_bin = "/home/coder/cuspatial/cpp/build/release/benchmarks/LINESTRING_DISTANCES_BENCH"
attr_names = ["NumPairs",
"NumLineStringsPerMultiLineString",
"NumSegmentsPerLineString"]
@dataclass
@isVoid
isVoid / spline_bench.ipynb
Created August 16, 2022 02:54
Benchmark cuspatial CubicSpline against Scipy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@isVoid
isVoid / RollingVarErrorAnalysis.ipynb
Last active August 24, 2021 00:30
Pandas rolling std vs cudf rolling std
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@isVoid
isVoid / cvn_get_loc_bench.py
Created June 14, 2021 22:25
Using cupy/numpy in get_loc
import cupy as cp
import pandas as pd
import cudf
def make_non_monotonic_non_unique_multiindex(N):
half_n = int(N / 2)
l0 = cp.concatenate([cp.arange(0, half_n), cp.full(half_n, 42)])
l1 = cp.concatenate([cp.arange(half_n, N), cp.full(half_n, 42)])
random_order = cp.arange(0, N)
cp.random.shuffle(random_order)
@isVoid
isVoid / pvc_get_loc_bench.py
Created June 14, 2021 22:22
Pandas vs cudf get_loc benchmark
import cupy as cp
import pandas as pd
import cudf
import time
def make_non_monotonic_non_unique_multiindex(N):
half_n = int(N / 2)
l0 = cp.concatenate([cp.arange(0, half_n), cp.full(half_n, 42)])
l1 = cp.concatenate([cp.arange(half_n, N), cp.full(half_n, 42)])
random_order = cp.arange(0, N)
@isVoid
isVoid / Argument.py
Last active March 19, 2020 17:54
BART Model Arguments and Definition
Namespace(activation_fn='gelu', adam_betas='(0.9, 0.999)', adam_eps=1e-06, adaptive_softmax_cutoff=None, adaptive_softmax_dropout=0, arch='bart_large', attention_dropout=0.1, best_checkpoint_metric='loss', bilm_add_bos=False, bilm_attention_dropout=0.0, bilm_mask_last_state=False, bilm_model_dropout=0.1, bilm_relu_dropout=0.0, bpe='gpt2', bucket_cap_mb=25, clip_norm=0.1, cpu=False, criterion='cross_entropy', cross_self_attention=False, curriculum=0, data='[PATH TO PRETRAINED WEIGHTS]', dataset_impl='mmap', ddp_backend='c10d', decoder_attention_heads=16, decoder_embed_dim=1024, decoder_embed_path=None, decoder_embed_scale=1.0, decoder_ffn_embed_dim=4096, decoder_input_dim=1024, decoder_layerdrop=0, decoder_layers=12, decoder_layers_to_keep=None, decoder_learned_pos=True, decoder_normalize_before=False, decoder_output_dim=1024, decoder_to_encoder_attention_layers=12, device_id=0, disable_validation=False, distributed_backend='nccl', distributed_init_method='tcp://learnfair1688:55498', distributed_no_spawn=True,