Skip to content

Instantly share code, notes, and snippets.

Marek Kolodziej mkolod

Block or report user

Report or block mkolod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pcie_bw.py
import torch
from time import time
# initialize CUDA, to not count startup later
foo = torch.ones(1).cuda()
MB = 1 << 20
# 27 MB tensor
NUM_MB = 27
@mkolod
mkolod / ipc_demo.py
Created Apr 16, 2020 — forked from lebedov/ipc_demo.py
Demonstrate how to pass IPC handles to GPU data between processes in Python
View ipc_demo.py
#!/usr/bin/env python
"""
Demonstrate how to pass IPC handles to GPU data between processes in Python.
"""
import ctypes
import numpy as np
import multiprocessing as mp
import zmq
View gpu_utilization.py
#!/usr/bin/env python
import numpy as np
import sqlite3 as lite
import sys
from contextlib import ContextDecorator
class DbContext(ContextDecorator):
def __init__(self, file_path):
self.file_path = file_path
View print_search_path.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mkolod
mkolod / dlopen_driver.cpp
Created Dec 17, 2019
Preloading shared lib (CUDA driver) before main runs
View dlopen_driver.cpp
#include <iostream>
#include <iomanip>
#include <dlfcn.h>
using std::cout;
using std::cerr;
using std::endl;
void* h = []() {
View weighted_resampling_using_cdf_and_resampling_wheel.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View spmv_using_csr_matrix.cpp
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
template <typename T>
struct CSR {
CSR(const std::vector<T>& A, const std::vector<int>& IA, const std::vector<int>& JA) :
View sparse_vector_dot_product_dok_vs_structs.cpp
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
struct SparseVec {
std::vector<int> values;
std::vector<int> indices;
};
View dl_scale_quantization.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View conv2d_via_im2col_and_gemm.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.