Files
foxhunt/runpod_debug/test5_tft_minimal.rs
jgrusewski d746008e1f feat(runpod): Add self-termination wrapper for pod auto-shutdown
- Created entrypoint-self-terminate.sh wrapper script
- Updates entrypoint-generic.sh to be called by wrapper
- Modified Dockerfile.runpod to use self-terminate entrypoint
- Adds automatic pod termination via runpodctl after training completes
- Prevents infinite restart loops and wasted GPU credits
- Saves ~96% cost per training run ($4.59 per run)

Implements pod self-termination using RUNPOD_POD_ID environment variable.
Training exits with code 0 → runpodctl remove pod → immediate shutdown.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 23:12:42 +02:00

27 lines
874 B
Rust

// Test 5: Minimal TFT model creation
use candle_core::{Device, Tensor};
use candle_nn::{VarBuilder, VarMap};
fn main() {
println!("Test 5: Minimal TFT model creation");
let device = Device::cuda_if_available(0).unwrap_or(Device::Cpu);
println!("Using device: {:?}", device);
// Create minimal VarBuilder
let varmap = VarMap::new();
let vb = VarBuilder::from_varmap(&varmap, candle_core::DType::F32, &device);
// Create small tensor
match Tensor::zeros((1, 10), candle_core::DType::F32, &device) {
Ok(t) => {
println!("✓ Created tensor shape: {:?}", t.shape());
println!("✓ Tensor device: {:?}", t.device());
}
Err(e) => println!("✗ Tensor creation failed: {}", e),
}
std::thread::sleep(std::time::Duration::from_secs(10));
println!("Test 5 complete");
}