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
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
let | |
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" '' | |
export __NV_PRIME_RENDER_OFFLOAD=1 | |
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 |
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
name: ait | |
channels: | |
- pytorch | |
- nvidia | |
- conda-forge | |
- defaults | |
dependencies: | |
- _libgcc_mutex=0.1=conda_forge | |
- _openmp_mutex=4.5=2_gnu | |
- binutils_impl_linux-64=2.38=h2a08ee3_1 |
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
{ | |
"channels": [ | |
"intel", | |
"defaults" | |
], | |
"dependencies": [ | |
"_libgcc_mutex=0.1=main", | |
"_pytorch_select=0.2=gpu_0", | |
"absl-py=0.8.1=py36_0", | |
"asn1crypto=0.24.0=py36_3", |
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
TORCH_VER="20191208" | |
pip uninstall -y torch torchvision | |
rm -r wheels | |
mkdir -p wheels | |
for f in {torch,torch_xla,torchvision}; do | |
whl="${f}-nightly+${TORCH_VER}-cp36-cp36m-linux_x86_64.whl"; | |
gsutil cp "gs://tpu-pytorch/wheels/${whl}" wheels/; | |
pip install "wheels/${whl}"; | |
done | |
apt-get install -y libomp5 |
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
class MUniquePointerPrinter: | |
""" Print a unique_ptr with pointed-to-value | |
credits: https://gcc.gnu.org/ml/libstdc++/2013-04/msg00098.html | |
""" | |
def __init__ (self, typename, val): | |
self.val = val | |
def to_string (self): | |
v = self.val['_M_t']['_M_head_impl'] |
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
#include <iostream> | |
template<typename TNum> | |
constexpr TNum min2 (TNum first, TNum second) | |
{ | |
return (first < second) ? first : second; | |
} | |
template<typename TNum, typename... Args> | |
constexpr TNum |
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
function get_parallelogram_area(vertice_a, vertice_b, vertice_c) | |
implicit none | |
real*8, dimension(1 : 3) :: vertice_a, vertice_b, vertice_c | |
real*8, dimension (1 : 3) :: vector_ab, vector_ac | |
real*8, dimension(1 : 3) :: cross_product | |
real*8 :: get_parallelogram_area | |
interface | |
function get_cross_product (vector_ab, vector_ac) |
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
#include <iostream> | |
using std::cout; | |
using std::endl; | |
template<typename T> | |
struct TypeTraits { | |
static bool const IsPTR = false; | |
}; |
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
require 'nokogiri' | |
require 'open-uri' | |
MARK_FILE = "mark.dat" | |
MAX_THREADS = 5 | |
def wait_for_threads(threads) | |
print "Waiting for downloads to finish..." | |
threads.each { |t| t.join } | |
puts " ok" |