Skip to content

Commit 0e7071d

Browse files
committed
Resolve review comments
Signed-off-by: Md Soharab Ansari <[email protected]>
1 parent 7a674db commit 0e7071d

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

content/en/blog/running-gpu-based-functions-on-fission.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In this guide, we will show you how to set up a GPU-enabled Fission environment
1919
GPUs are efficient for SIMD (Single Instruction, Multiple Data) computations, which are commonly used in deep learning and matrix operations.
2020
Many serverless workloads need to perform these operations, and GPUs can help you run them more efficiently.
2121

22-
Fission users have been using Fission for ML model deployment and various use cases, some of organizations are using Fission for production workloads and need to run GPU-based functions to meet their performance requirements.
22+
Fission users have been using Fission for ML model deployment and various use cases, some of the organizations are using Fission for production workloads and need to run GPU-based functions to meet their performance requirements.
2323

2424
## Pre Requisites
2525

@@ -33,7 +33,7 @@ Please refer to [Kubernetes GPU Support](https://kubernetes.io/docs/tasks/manage
3333

3434
Nvidia GPU operator helps in managing GPU resources in Kubernetes cluster. It provides a way to configure and manage GPUs in Kubernetes.
3535
You can refer to [Guide to NVIDIA GPU Operator in Kubernetes](https://www.infracloud.io/blogs/guide-to-nvidia-gpu-operator-in-kubernetes/).
36-
You should have see nodes with gpu label in your cluster.
36+
You should have seen nodes with gpu label in your cluster.
3737

3838
```bash
3939
$ kubectl get node -l nvidia.com/gpu.present=true
@@ -51,9 +51,9 @@ Before you start working on this demo, you need to ensure that you have Fission
5151

5252
Fission function need an environment to run the function code. For running GPU based functions, we need to create an environment which can leverage the GPU resources.
5353

54-
Following are the steps to create a environment with GPU support and run a GPU based function.
54+
Following are the steps to create an environment with GPU support and run a GPU based function.
5555

56-
- We would a Python based environment runtime and builder images with all the dependencies installed for running a GPU based function. Eg. Pytorch, Cuda, etc.
56+
- We would create a Python based environment runtime and builder images with all the dependencies installed for running a GPU based function. E.g. Pytorch, Cuda, etc.
5757
- Verify the environment and builder images are functional and can utilize the GPU resources.
5858
- Create a function package using [sentiment analysis model from huggingface](https://huggingface.co/distilbert/distilbert-base-uncased-finetuned-sst-2-english) and then create a function using this package.
5959
- Run the function and verify sentiment analysis for a given sentence.
@@ -171,22 +171,14 @@ In this step, we will do following things:
171171
```
172172

173173
- The `fission env create` command will create two deployments. One deployment named `poolmgr-python-default-*` for environment and another for builder named `python-*`.
174-
- Edit the environment deployment and add GPU resources to `python` environment container.
175-
176-
```yaml
177-
resources:
178-
limits:
179-
nvidia.com/gpu: "1"
180-
requests:
181-
nvidia.com/gpu: "1"
182-
```
174+
- Patch the environment deployment to add GPU resources to `python` environment container and set `nodeSelector` to schedule pods on a GPU node using `kubectl patch` command.
183175

184-
```yaml
185-
nodeSelector:
186-
kubernetes.io/hostname: gpu-node03
176+
```bash
177+
kubectl patch deployment poolmgr-python-default-5560759 -p '{"spec": {"template": {"spec":{"containers":[{"name":"python","resources": {"limits": {"nvidia.com/gpu": "1"}, "requests": {"nvidia.com/gpu": "1"}}}]}}}}'
178+
kubectl patch deployment poolmgr-python-default-5560759 -p '{"spec": {"template": {"spec": {"nodeSelector": {"kubernetes.io/hostname": "infracloud03"}}}}}'
187179
```
188180

189-
- After edit, make sure that pods are schduled on GPU nodes and respective environment container spec have gpu resources.
181+
- After patch, make sure that pods are schduled on GPU nodes and respective environment container spec have gpu resources.
190182

191183
#### Check Cuda device with a Fission Function
192184

@@ -329,7 +321,7 @@ Sentiment: NEGATIVE
329321

330322
## Conclusion
331323

332-
This tutorial shows how to setup a GPU based environment and run a GPU based function on Fission.
324+
This tutorial shows how to set up a GPU based environment and run a GPU based function on Fission.
333325
Similar steps can be followed to deploy other models and use cases with GPU acceleration.
334326
We will soon be adding more examples with different models and use cases.
335327

0 commit comments

Comments
 (0)