Scaling GPU Capacity with Juice Pools and GPU Trader
Announcing the Juice Managed Template on GPU Trader. Now users of Juice can augment their pooled GPU resources with on-demand capacity, scaling up when needed. Juice Labs provides software “Juice” that enables GPU-over-IP, allowing your GPUs to become remote virtual resources: pooled, shared, and accessed by AI and graphics workloads. This allows you to share and better utilize your existing GPUs in your organization. But what if you need additional capacity beyond your fleet? That is where GPU Trader can help. The Juice Managed Template allows users to quickly rent and integrate on-demand capacity from GPU Trader to new or existing GPU Pools on Juice.
In this blog, you will learn how to rent an on-demand instance from GPU Trader, install the Juice Agent using our managed template, add the capacity to your Juice GPU pool, and access the capacity from your workstation. If you are new to Juice, their documentation provides detailed instructions on configuration.
These are the major steps we will cover:
Here are some prerequsites for completing this tutorial:
Let’s get started!
Log in to the Juice console at https://app.juicelabs.co/ or use your terminal to run the juice gpu list
command to see how many GPUs are in your pool. Currently, we have two.
For this example, we’ll run a simple PyTorch Python script showing the number of available GPUs.
To run this script and access the GPUs in our Juice Pool, we wrap the script with the Juice CLI, passing in the option to request the number of GPUs we wish to use. Let’s use four GPUs. Hint: It won’t work.
Because there are currently only 2 GPUs in our pool, we get an error saying we do not have enough capacity.
So, what do we do if we want to utilize more GPUs than exist in our pool because our workload requires it, or we want to accelerate it? GPU Trader is an AI platform that allows users to find additional capacity and use it on demand. To find a GPU, log in to the GPU Trader Console at https://console.gputrader.io.
Log in and rent an on-demand GPU instance from GPU trader to find additional capacity and add it to our Juice Pool.
To find an instance:
If you made it this far, you have successfully rented a GPU! Now we can configure the instance with the Juice Agent and add it to your Juice Pool.
In the template’s YAML, you will notice three environment variables; only two need to be added: JUICE_TOKEN
and JUICE_POOL
. The GPU Trader platform will automatically add the JUICE_HOST_IP
using ${EXTERNAL_IP}
.
For the next two steps, add the Key and Value, and then click “Add” to add the variable to your template.
3.1 JUICE_TOKEN
: Generate the Machine-to-Machine token from your terminal using the following command:
Refer to the Juice M2M Tokens documentation for help.
Example output:
image
Copy the token output into the environment variable “Value.”
3.2 JUICE_POOL
: In your terminal, run the command juice pool ls to list your pool IDs. Copy the ID of the pool you wish to use and paste it into the environment variable “Value.”
Example output:
image
3.3 If you did the last two steps correctly, your template should look like this example:
image
JUICE_TOKEN
and JUICE_POOL
, click “Use Template” to instantiate the stack on your instance. Once it is complete, it should look like this:You did it! You’ve added eight more GPUs to your pool.
To verify the GPUs are in your pool, you can log in to the Juice console or use the terminal to run the juice gpu list
command. You can see that we now have eight GPUs available in our pool.
Now, when we request 4 GPUs in our client program, we can successfully access them from the pool, and the program enumerates the GPUs:
When you are satisfied with the output, you can keep the GPU in our pool for as long as needed or release the rented instance until it is needed again.
To release the instance, return to the instance configuration page, click the “Kebab” menu, and select “End rental.”
That’s it!
Scaling GPU Capacity with Juice Pools and GPU Trader
Announcing the Juice Managed Template on GPU Trader. Now users of Juice can augment their pooled GPU resources with on-demand capacity, scaling up when needed. Juice Labs provides software “Juice” that enables GPU-over-IP, allowing your GPUs to become remote virtual resources: pooled, shared, and accessed by AI and graphics workloads. This allows you to share and better utilize your existing GPUs in your organization. But what if you need additional capacity beyond your fleet? That is where GPU Trader can help. The Juice Managed Template allows users to quickly rent and integrate on-demand capacity from GPU Trader to new or existing GPU Pools on Juice.
In this blog, you will learn how to rent an on-demand instance from GPU Trader, install the Juice Agent using our managed template, add the capacity to your Juice GPU pool, and access the capacity from your workstation. If you are new to Juice, their documentation provides detailed instructions on configuration.
These are the major steps we will cover:
Here are some prerequsites for completing this tutorial:
Let’s get started!
Log in to the Juice console at https://app.juicelabs.co/ or use your terminal to run the juice gpu list
command to see how many GPUs are in your pool. Currently, we have two.
For this example, we’ll run a simple PyTorch Python script showing the number of available GPUs.
To run this script and access the GPUs in our Juice Pool, we wrap the script with the Juice CLI, passing in the option to request the number of GPUs we wish to use. Let’s use four GPUs. Hint: It won’t work.
Because there are currently only 2 GPUs in our pool, we get an error saying we do not have enough capacity.
So, what do we do if we want to utilize more GPUs than exist in our pool because our workload requires it, or we want to accelerate it? GPU Trader is an AI platform that allows users to find additional capacity and use it on demand. To find a GPU, log in to the GPU Trader Console at https://console.gputrader.io.
Log in and rent an on-demand GPU instance from GPU trader to find additional capacity and add it to our Juice Pool.
To find an instance:
If you made it this far, you have successfully rented a GPU! Now we can configure the instance with the Juice Agent and add it to your Juice Pool.
In the template’s YAML, you will notice three environment variables; only two need to be added: JUICE_TOKEN
and JUICE_POOL
. The GPU Trader platform will automatically add the JUICE_HOST_IP
using ${EXTERNAL_IP}
.
For the next two steps, add the Key and Value, and then click “Add” to add the variable to your template.
3.1 JUICE_TOKEN
: Generate the Machine-to-Machine token from your terminal using the following command:
Refer to the Juice M2M Tokens documentation for help.
Example output:
image
Copy the token output into the environment variable “Value.”
3.2 JUICE_POOL
: In your terminal, run the command juice pool ls to list your pool IDs. Copy the ID of the pool you wish to use and paste it into the environment variable “Value.”
Example output:
image
3.3 If you did the last two steps correctly, your template should look like this example:
image
JUICE_TOKEN
and JUICE_POOL
, click “Use Template” to instantiate the stack on your instance. Once it is complete, it should look like this:You did it! You’ve added eight more GPUs to your pool.
To verify the GPUs are in your pool, you can log in to the Juice console or use the terminal to run the juice gpu list
command. You can see that we now have eight GPUs available in our pool.
Now, when we request 4 GPUs in our client program, we can successfully access them from the pool, and the program enumerates the GPUs:
When you are satisfied with the output, you can keep the GPU in our pool for as long as needed or release the rented instance until it is needed again.
To release the instance, return to the instance configuration page, click the “Kebab” menu, and select “End rental.”
That’s it!