Adding Swap Space#
The default Qwen3.6-35B-A3B configuration uses FP8 with a 60k context window on a shared-RAM host. On the on-device PTL profile, provide at least 32 GB of swap as a memory-pressure safety net. Swapping can slow model loading and does not guarantee that model or device allocations will succeed; verify peak memory use for your workload.
Step 1. Check current swap#
swapon --show
If swap is not enabled, or the total is less than 32 GB, add a swap file as below.
Step 2. Create a temporary swap file#
# Create a 32 GB swap file
sudo fallocate -l 32G /swapfile_temp
sudo chmod 600 /swapfile_temp
sudo mkswap /swapfile_temp
sudo swapon /swapfile_temp
# Verify
swapon --show
# e.g. an existing /swap.img (8G) + /swapfile_temp (32G) = 40G total swap
Step 3. Lower swappiness#
Tell the kernel to use swap only when necessary, avoiding unnecessary paging:
sudo sysctl vm.swappiness=10
To persist this setting across reboots (idempotent):
echo 'vm.swappiness=10' | sudo tee /etc/sysctl.d/99-swap.conf
sudo sysctl -q vm.swappiness=10
Keeping or removing the swap file#
Recommended: keep the swap file as a safety net. Once it is active, restarting the services does not require setting up temporary swap again.
To make the swap file survive reboots, add it to /etc/fstab:
echo '/swapfile_temp none swap sw 0 0' | sudo tee -a /etc/fstab
To remove the temporary swap when you no longer need it:
# Remove the temporary swap
sudo swapoff /swapfile_temp
sudo rm /swapfile_temp
# Restore default swappiness
sudo sysctl vm.swappiness=60
Note
If you added the swap file to /etc/fstab, also remove its line there before deleting the file, otherwise the next boot will fail to mount it.