Skip to content

Commit

Permalink
Add screenshots
Browse files Browse the repository at this point in the history
Signed-off-by: giraffekey <[email protected]>
  • Loading branch information
giraffekey committed Dec 8, 2024
1 parent 6f73bf3 commit a44536b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions articles/20240820_gpu_utilization.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ You can test the script in your workspace with the following command:
python3 inference.py
```

Which should output generated text like so:

![output example](assets/20240820_gpu_utilization_img3.jpg)

### Create a Docker Container

To run this script in a [Docker](/definitions/20240819_definition_docker.md) container, we'll be using the following Dockerfile:
Expand Down Expand Up @@ -232,25 +236,21 @@ This `Dockerfile` sets up a GPU-enabled environment, installs Python and the nec

### Build and Run the Docker Container

With your `Dockerfile` ready, build and run the container:
With your `Dockerfile` ready, build the container:

```bash
# Build the container
docker build -t llm-gpu .

# Run the container with GPU support
docker run --gpus all llm-gpu
```

### Output
![docker build output](assets/20240820_gpu_utilization_img4.jpg)

Running the script should generate text similar to the following:
And run it with NVIDIA GPUs enabled:

```
Once upon a time in a land far, far away, they would be able to see through their mind, and understand their own thoughts. We should be ashamed of ourselves, but we must not be ashamed of ourselves. We can only see and feel
```bash
docker run --gpus all llm-gpu
```

The output will be different each time the command is run.
![docker run output](assets/20240820_gpu_utilization_img5.jpg)

## Implementing Advanced Text Generation Techniques

Expand Down Expand Up @@ -285,13 +285,7 @@ if __name__ == "__main__":

By increasing the temperature all the way to 2.0, the generated text becomes more creative and often less coherent.

Here's an example:

```
Once upon a time in a land far, far away
There stood one and no boy, the name came over in one. One that spoke so loudly he was the best that could play; they looked me in the eyes, he sat on
```
![docker run output](assets/20240820_gpu_utilization_img6.jpg)

It's important to play around with these values in order to achieve the preferred output.

Expand Down Expand Up @@ -353,6 +347,8 @@ Run the script with:
python3 benchmark.py
```

![docker run output](assets/20240820_gpu_utilization_img7.jpg)

Running this script will help you assess the performance of your model and guide optimization efforts.

## Optimization and Troubleshooting
Expand Down
Binary file added articles/assets/20240820_gpu_utilization_img3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added articles/assets/20240820_gpu_utilization_img5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added articles/assets/20240820_gpu_utilization_img6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added articles/assets/20240820_gpu_utilization_img7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a44536b

Please sign in to comment.