Skip to content

Instantly share code, notes, and snippets.

@sub-mod
sub-mod / dcan.py
Created March 9, 2018 01:26
dcan.py
"""This file contains some basic model components"""
import tensorflow as tf
from tensorflow.python.ops.rnn_cell import DropoutWrapper
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.ops import rnn_cell
from operator import mul
class LSTMEncoder(object):
@sub-mod
sub-mod / tf_build_notes.txt
Last active July 13, 2018 17:39
tensorflow build notes
need to install bazel
https://copr.fedorainfracloud.org/coprs/vbatts/bazel/
oc new-app --template=tensorflow-build-image --param=APPLICATION_NAME=tf-fedora27-builder-image-36 --param=S2I_IMAGE=registry.fedoraproject.org/f27/s2i-core --param=DOCKER_FILE_PATH=Dockerfile.fedora27 --param=NB_PYTHON_VER=3.6 --param=VERSION=4
oc new-app --template=tensorflow-build-job --param=APPLICATION_NAME=tf-build-fc27-363 --param=BUILDER_IMAGESTREAM=docker-registry.default.svc:5000/dh-prod-analytics-factory/tf-fedora27-builder-image-36:3 --param=NB_PYTHON_VER=3.6 --param=GIT_TOKEN= --param=CUSTOM_BUILD="gcc -march=native -Q --help=target|grep march && gcc -march=native -E -v - </dev/null 2>&1 | grep cc1 && grep flags -m1 /proc/cpuinfo | cut -d ":" -f 2 | tr '[:upper:]' '[:lower:]' && lscpu && bazel build -c opt --copt='-march=core-avx2' --cxxopt='-D_GLIBCXX_USE_CXX11_ABI=0' --local_resources 2048,2.0,1.0 --verbose_failures //tensorflow/tools/pip_package:build_pip_package"
gcc -march=native -Q --help=target|grep marc
@sub-mod
sub-mod / cmds.md
Last active April 16, 2019 20:49
GPU testing on Openshift 3.10:
@sub-mod
sub-mod / load_incluster_config.py
Created October 24, 2018 22:35
Remove load_incluster_config
from openshift.dynamic import DynamicClient
from kubernetes.client import Configuration, ApiClient
from kubernetes.config.incluster_config import InClusterConfigLoader
import urllib3
def load_incluster_config(environ):
"""Use the service account kubernetes gives to pods to connect to kubernetes
cluster. It's intended for clients that expect to be running inside a pod
@sub-mod
sub-mod / centos7_okd311.txt
Created February 28, 2019 05:51
centos7_okd311
#set root password if not set
sudo passwd
sudo yum update -y
sudo vi /etc/ssh/sshd_config
Make sure below 2 lines exists with yes
PermitEmptyPasswords yes
PasswordAuthentication yes
@sub-mod
sub-mod / pl-tensorflowapp_test.txt
Last active March 11, 2019 19:19
pl-tensorflowapp test
$ docker version
Client: Docker Engine - Community
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 4c52b90
Built: Wed Jan 9 19:33:12 2019
OS/Arch: darwin/amd64
Experimental: false
@sub-mod
sub-mod / ssd_perf.md
Created April 24, 2019 01:15
SSD performance
/Volumes/Samsung_T5/development/TEST_SSD$ time git clone https://github.com/openshift/origin.git
Cloning into 'origin'...
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 533223 (delta 7), reused 9 (delta 4), pack-reused 533170
Receiving objects: 100% (533223/533223), 976.50 MiB | 9.93 MiB/s, done.
Resolving deltas: 100% (339788/339788), done.
Checking connectivity... done.
@sub-mod
sub-mod / kubleflow_thoth_tf.md
Last active May 15, 2019 22:51
kubleflow + thoth TF image

Install kustomize

opsys=linux  # or darwin, or windows
curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/latest |\
  grep browser_download |\
  grep $opsys |\
  cut -d '"' -f 4 |\
  xargs curl -O -L
mv kustomize_*_${opsys}_amd64 kustomize  
chmod u+x kustomize  
@sub-mod
sub-mod / centos6_tf_build_pass.txt
Last active June 13, 2019 02:31
centos6_tf_build_pass
bash-4.1# auditwheel show tensorflow-gpu-1.13.1-cp
tensorflow-gpu-1.13.1-cp27-none-linux_x86_64.whl tensorflow-gpu-1.13.1-cp36-cp36m-linux_x86_64.whl
bash-4.1# auditwheel show tensorflow-gpu-1.13.1-cp36-cp36m-linux_x86_64.whl
tensorflow-gpu-1.13.1-cp36-cp36m-linux_x86_64.whl is consistent with
the following platform tag: "linux_x86_64".
The wheel references external versioned symbols in these system-
provided shared libraries: librt.so.1 with versions {'GLIBC_2.2.5'},
libgcc_s.so.1 with versions {'GCC_3.0'}, libcudart.so.10.0 with
@sub-mod
sub-mod / TF_1.13.1_manylinux.patch
Created June 5, 2019 19:25
TF_1.13.1_manylinux.patch
diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl
index d93e0df..8825820 100644
--- a/tensorflow/tensorflow.bzl
+++ b/tensorflow/tensorflow.bzl
@@ -377,7 +377,7 @@ def tf_cc_shared_object(
srcs = [],
deps = [],
data = [],
- linkopts = [],
+ linkopts = ['-lrt'],