Compute usage with Code Workspaces

With Code Workspaces, users can securely connect to existing internal systems and build analyses, models, applications, or entire workflows on data with Foundry’s access controls and data permissioning.

Code workspaces spin up dedicated Foundry computation modules for execution, which utilizes Foundry compute-seconds while in use.

Pricing

Code workspace usage is tracked as Foundry compute-seconds (see usage types). Compute seconds are measured as long as the workspace is starting or active. There are a few factors to determine compute seconds used:

  • The number of virtual CPUs (vCPUs).
  • The gibibits (GiB) of RAM.
  • The workspace being used.
  • The number and the type of GPUs.

When paying for Foundry usage, the default rates are as follows:

WorkspaceGPU TypeUsage Rate
VS CodeNo GPU0.1
JupyterLab®No GPU0.5
RStudio®No GPU0.5
DashNo GPU0.5
StreamlitNo GPU0.5
Shiny®No GPU0.5
Any workspaceT4 GPU1.2
Any workspaceA10G GPU1.5
Any workspaceV100 GPU3.0

If you have an enterprise contract with Palantir, contact your Palantir representative before proceeding with compute usage calculations.

vcpu_compute_seconds = max(vCPUs, GiB_RAM/ 7.5) * vcpu_usage_rate * time_active_in_seconds

The following formula measures GPU compute seconds:

gpu_compute_seconds = GPUs * gpu_usage_rate * time_active_in_seconds

Each code workspace comes with a Foundry sidecar that introduces a small overhead of 0.25 vCPUs and 3 GiB of RAM

WorkspaceCompute ProfileDurationIncurred Usage
VS Code1 CPU/8 GiB1 hour528 compute-seconds
VS Code1 CPU/8 GiB4 hour2112 compute-seconds
VS Code4 CPUs/32 GiB1 hour1680 compute-seconds
JupyterLab®1 CPU/8 GiB1 hour2640 compute-seconds
Any workspace1 T4 GPU1 hour4320 compute-seconds
Any workspace1 A10G GPU1 hour5400 compute-seconds
Any workspace1 V100 GPU1 hour10800 compute-seconds

View workspace utilization

Live workspace utilization metrics are available for CPU, memory and disk usage. To view these metrics, expand the Workspace utilization section of the Settings side panel.

The workspace utilization section.

Measuring Foundry compute

When a Code Workspace is opened, Foundry will launch a dedicated compute session for the workspace. The session's status is STARTING until the session is available, becomes INITIALIZING, and then RUNNING. When the user manually stops the session, or when no user interaction is detected for longer than the auto-shutdown timeout, the session will become STOPPING and then IDLE. Foundry compute seconds are only used when the session is INITIALIZING or RUNNING.

All the possible states for a workspace are listed below. The states when the code workspace uses compute are indicated with right arrows (→).

  • STARTING: a new session was requested
  • INITIALIZING: the session is available and is being config
  • RUNNING: the session is available and usable
  • STOPPING: the session is stopping
  • IDLE: the session is stopped
  • FAILED: an error occurred
  • TERMINATING: the session is being deleted permanently
  • NOT STARTED: no session available for this workspace

Code Workspaces measure compute seconds in the same manner as other scaling compute in the platform. Review the general Foundry Compute documentation for a description of how it is measured.

Investigating Foundry compute usage with Code Workspaces

Foundry Code Workspaces attribute all associated compute to the workspace resource in the filesystem. You can always view the usage of all sessions in the Resource Management Application.

Understanding drivers of Foundry compute usage in Code Workspaces

The compute usage of a Code Workspace session is directly proportional to the dedicated computational resources available to session and the length of the session.

To manage the hardware size of your session, go to Settings > Compute Resources. You can choose from a variety of different session sizes. Refer to the screenshot below for an indication of how you can choose sizes and optionally allocate GPUs to your workspace. The resource queue in the project containing your workspace determines available GPUs. Learn more about using GPUs in projects.

Manage Session Size

Long-running sessions utilize more compute than short-running sessions. Be sure to tune your auto-shutdown time to be consistent with your working style to not use more compute than necessary. You should manually stop sessions when you know you are done.

Manual Session Stop