Two ways to enable GPU in Kubernetes:
If you want to enable GPU resource in Kubernetes and want Kubelet to allocate it. You need config it as following ways:
Kubernetes 1.7: Using NVidia container and enable Kuberlet config feature-gates=Accelerators=true
Kubernetes 1.9: Using Device Plugin with Kuberlet specific config feature-gates=DevicePlugins=true
Check node if it has GPU resource:
Using kubectl command kubectl get node YOUR_NODE_NAME -o json to export all node info as json format. You should see something like:
## If you use Kubernetes Accelerator after 1.7
"allocatable": {
"cpu": "32",
"memory": "263933300Ki",
"alpha.kubernetes.io/nvidia-gpu": "4",
"pods": "110"
},
Detail defined in k8s.io/api/core/v1/types.go
## If you use Kubernetes Device Plugin after 1.9
"allocatable": {
"cpu": "32",
"memory": "263933300Ki",
"nvidia.com/gpu": "4",
"pods": "110"
}, ## Reference:
Managing Compute Resources for Containers
Kubernetes: Device Plugin
NVIDIA-k8s-device-plugin
中文前言: 在使用 Kubernetes 的時候,可以選擇透過 Job 的方式來跑一次性的工作.但是如果希望你的工作在特定時間內一定得結束來釋放資源, 就得透過這個方式. 最近在研究這個的時候,發現有些使用上的小技巧,紀錄一下. Preface: If you want to force to terminate your kubernetes jobs if it exceed specific time. (e.g.: run a job no longer than 2 mins). In this case you can use a watcher to monitor this Kubernetes jobs and terminate it if exceed specific time. Or you can refer K8S Doc:”Job Termination and Cleanup” use activeDeadlineSeconds to force terminare your jobs. How to use activeDeadlineSeconds: It is very easy to setup activeDeadlineSeconds in spec. apiVersion: batch/v1 kind: Job metadata: name: myjob spec: backoffLimit: 5 activeDeadlineSeconds: 100 template: spec: containers: - name: myjob image: busybox command: ["sleep", "300"] restartPolicy: Never In this example, this job will be terminated after 100 seconds (if it works well :p ) Before you use activeDeadlineSeconds If you ever run a job with activeDeadlineSeconds, you will need delete job before you run the same job again. The job...
論文原文: The Case for Learned Index Structures
Morning Paper Reading: part1, par2
參考文章:
arXiv: The Case for Learned Index Structures
Morning paper: The case for learned index structures – part I
Morning paper: The case for learned index structures – part II