Skip to content

Instantly share code, notes, and snippets.

View rkube's full-sized avatar

Ralph Kube rkube

View GitHub Profile
Verifying my Blockstack ID is secured with the address 1SpdtRGnfxyMNjdQxPoiZoYbKyLqHdCc4 https://explorer.blockstack.org/address/1SpdtRGnfxyMNjdQxPoiZoYbKyLqHdCc4
Verifying my Blockstack ID is secured with the address 1SpdtRGnfxyMNjdQxPoiZoYbKyLqHdCc4 https://explorer.blockstack.org/address/1SpdtRGnfxyMNjdQxPoiZoYbKyLqHdCc4
Verifying my Blockstack ID is secured with the address 1SpdtRGnfxyMNjdQxPoiZoYbKyLqHdCc4 https://explorer.blockstack.org/address/1SpdtRGnfxyMNjdQxPoiZoYbKyLqHdCc4
@rkube
rkube / gist:be4869dddc83594fec57988b10203417
Created August 24, 2020 19:20
Running disruptcnn on Ascent
cd to the shared project folder:
$ cd /gpfs/wolf/gen141/proj-shared
Create a run directory
$ mkdir mydir
$ cd mydir
Clone the current working branch from github. F.ex. my Dali branch:
@rkube
rkube / gist:54d9c746108b3762977bb7c0b97b9386
Last active September 16, 2020 13:05
Example slurm script for ray
#!/bin/bash
#SBATCH --job-name=test
#SBATCH --cpus-per-task=5
#SBATCH --mem-per-cpu=1GB
#SBATCH --nodes=4
#SBATCH --tasks-per-node=1
#SBATCH --time=00:30:00
#SBATCH --reservation=test
@rkube
rkube / gist:ccdd21b8009e5be281f3870a0caec47c
Last active July 8, 2021 17:54
pullbacks for QR decomposition
using LinearAlgebra
using Zygote
using ChainRules
using ChainRulesCore
using Random
using Statistics
using FiniteDifferences
using ChainRulesTestUtils
@rkube
rkube / chainrules_qr_pullback.jl
Last active July 9, 2021 20:32
Updated code for qr-factorization pullback
using LinearAlgebra
using Zygote
using ChainRules
using ChainRulesCore
using Random
using Statistics
using FiniteDifferences
using ChainRulesTestUtils
@rkube
rkube / pytorch_qr_pullback.py
Last active July 9, 2021 20:31
Verification of qr-pullback with pytorch
import torch
def f1(A):
q, r = torch.qr(A)
return q.sum()
def f2(A):
q, r = torch.qr(A)
return r.sum()
@rkube
rkube / qr_pullback_gpu_mwe.jl
Last active August 25, 2021 20:03
Minimal working example of QR pullback
using LinearAlgebra
using Zygote
using ChainRules
using ChainRulesCore
using Random
using CUDA
Random.seed!(1234);
function ChainRules.rrule(::typeof(qr), A::CuArray{T}) where {T}
@rkube
rkube / qr_backprop_mwe.jl
Created August 30, 2021 17:39
Backpropagating through QR-factorization code
using CUDA
using LinearAlgebra
using Random
using Zygote
using ChainRules
using ChainRulesCore
CUDA.allowscalar(false)
Random.seed!(1234)