Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/freesched.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ typedef struct fs_dev_info {
float handoff_overhead_us; /* Baseline sync_file / cache-sync handoff latency */
float typical_watts;
uint32_t sram_kb;
uint32_t max_inflight; /* Matches OB_MAX_CREDITS (16) on EdgeTPU */
uint32_t max_inflight; /* Matches FREETPU_MAX_CREDITS (16) on EdgeTPU */
fs_thermal_power_model_t thermal_model; /* Zero-init (NONE) falls back to typical_watts */
float junction_temp_c; /* Default T_j (degC); 0 or NaN -> ref_temp_c */
uint32_t opp_count; /* 0 = use device peaks */
Expand Down Expand Up @@ -203,7 +203,7 @@ typedef enum fs_dtype {
FS_DTYPE_I32 = 5
} fs_dtype_t;

/* Matches enum ob_activation in freetpu.h */
/* Matches enum freetpu_activation in freetpu.h */
typedef enum fs_activation {
FS_ACT_NONE = 0,
FS_ACT_RELU = 1,
Expand All @@ -212,7 +212,7 @@ typedef enum fs_activation {
FS_ACT_GELU = 5
} fs_activation_t;

/* Matches ob_block_q8_0_t (34 B) and ob_block_q4_0_t (18 B) byte-for-byte */
/* Matches freetpu_block_q8_0_t (34 B) and freetpu_block_q4_0_t (18 B) byte-for-byte */
#if defined(__GNUC__) || defined(__clang__)
typedef struct __attribute__((packed)) fs_block_q8_0 {
uint16_t d;
Expand Down Expand Up @@ -520,7 +520,7 @@ typedef struct fs_freetpu_config {
const char* device_path; /* NULL -> "/dev/edgetpu-soc" */
const char* dma_heap_path; /* NULL -> "/dev/dma_heap/system" */
int allow_mock_fallback; /* 1 = run exact host reference if TPU/lib absent */
uint8_t perf_mode; /* 0..5 DVFS tier matching ob_config_t::perf_mode */
uint8_t perf_mode; /* 0..5 DVFS tier matching freetpu_config_t::perf_mode */
uint8_t reserved[3];
const char* dive_interp_path; /* NULL -> FREETPU_DIVE_INTERP_PATH / firmware probe */
int enable_freetile; /* 1 = enable FreeTile BUENOS_A0 VLIW emitter (default 1) */
Expand Down
22 changes: 11 additions & 11 deletions include/pocketcoder_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,17 +324,17 @@ typedef struct pc_graph_stats {
uint64_t dma_sync_calls;
double max_abs_err;
double nmse;
int ob_hw_active;
int ob_emitter_active;
int ob_freetile_active;
uint64_t ob_calls;
uint64_t ob_tiles_dispatched;
uint64_t ob_hw_us;
uint64_t ob_w_hits;
uint64_t ob_w_misses;
uint64_t ob_w_evictions;
uint64_t ob_weight_pack_us;
uint64_t ob_weight_cache_bytes;
int freetpu_hw_active;
int freetpu_emitter_active;
int freetpu_freetile_active;
uint64_t freetpu_calls;
uint64_t freetpu_tiles_dispatched;
uint64_t freetpu_hw_us;
uint64_t freetpu_w_hits;
uint64_t freetpu_w_misses;
uint64_t freetpu_w_evictions;
uint64_t freetpu_weight_pack_us;
uint64_t freetpu_weight_cache_bytes;
} pc_graph_stats_t;

typedef struct pc_graph pc_graph_t;
Expand Down
342 changes: 171 additions & 171 deletions src/fs_backend_freetpu.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/fs_backend_vulkan_dmabuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ static fs_status_t fs_vulkan_dmabuf_import(void* user_data, fs_dmabuf_t* buf) {
/*
* CRITICAL: vkAllocateMemory with VkImportMemoryFdInfoKHR takes ownership
* of `fd` ONLY on VK_SUCCESS. Dup with CLOEXEC so Vulkan never closes
* freesched's shared buf->dmabuf_fd (needed by EdgeTPU ob_dmabuf_map).
* freesched's shared buf->dmabuf_fd (needed by EdgeTPU freetpu_dmabuf_map).
*/
const int dup_fd = fs_vk_dup_fd_cloexec(buf->dmabuf_fd);
if (dup_fd >= 0) {
Expand Down
22 changes: 11 additions & 11 deletions src/pc_dmabuf_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,17 @@ static fs_status_t pc_fill_graph_stats(const pc_graph_t* graph,
out_stats->dma_sync_calls = tel.dma_sync_calls;
out_stats->max_abs_err = parity.max_abs_err;
out_stats->nmse = parity.nmse;
out_stats->ob_hw_active = ob_prof.hw_active;
out_stats->ob_emitter_active = ob_prof.emitter_active;
out_stats->ob_freetile_active = ob_prof.freetile_active;
out_stats->ob_calls = ob_prof.calls;
out_stats->ob_tiles_dispatched = ob_prof.tiles_dispatched;
out_stats->ob_hw_us = ob_prof.hw_us;
out_stats->ob_w_hits = ob_prof.weight_cache_hits;
out_stats->ob_w_misses = ob_prof.weight_cache_misses;
out_stats->ob_w_evictions = ob_prof.weight_cache_evictions;
out_stats->ob_weight_pack_us = ob_prof.weight_pack_us;
out_stats->ob_weight_cache_bytes = ob_prof.weight_cache_bytes;
out_stats->freetpu_hw_active = ob_prof.hw_active;
out_stats->freetpu_emitter_active = ob_prof.emitter_active;
out_stats->freetpu_freetile_active = ob_prof.freetile_active;
out_stats->freetpu_calls = ob_prof.calls;
out_stats->freetpu_tiles_dispatched = ob_prof.tiles_dispatched;
out_stats->freetpu_hw_us = ob_prof.hw_us;
out_stats->freetpu_w_hits = ob_prof.weight_cache_hits;
out_stats->freetpu_w_misses = ob_prof.weight_cache_misses;
out_stats->freetpu_w_evictions = ob_prof.weight_cache_evictions;
out_stats->freetpu_weight_pack_us = ob_prof.weight_pack_us;
out_stats->freetpu_weight_cache_bytes = ob_prof.weight_cache_bytes;
return FS_OK;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/test_c11_abi.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

_Static_assert(sizeof(fs_block_q8_0_t) == 34u, "fs_block_q8_0_t must be 34 bytes");
_Static_assert(sizeof(fs_block_q4_0_t) == 18u, "fs_block_q4_0_t must be 18 bytes");
_Static_assert(FS_ACT_SILU == 4, "FS_ACT_SILU must match libfreetpu OB_ACT_SILU");
_Static_assert(FS_ACT_GELU == 5, "FS_ACT_GELU must match libfreetpu OB_ACT_GELU");
_Static_assert(FS_ACT_SILU == 4, "FS_ACT_SILU must match libfreetpu FREETPU_ACT_SILU");
_Static_assert(FS_ACT_GELU == 5, "FS_ACT_GELU must match libfreetpu FREETPU_ACT_GELU");

#define CHECK(cond) \
do { \
Expand Down
18 changes: 9 additions & 9 deletions tests/test_pocketcoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,15 +532,15 @@ bool test_dspark_dedup_and_dmabuf_graph() {
}
CHECK(gstats8.fallback_copies == 0u);
CHECK(gstats8.nmse < 1e-10);
CHECK(gstats8.ob_w_misses == gstats0.ob_w_misses);
CHECK(gstats8.ob_w_evictions == gstats0.ob_w_evictions);
CHECK(gstats8.ob_weight_pack_us == gstats0.ob_weight_pack_us);
if (gstats8.ob_emitter_active == 1) {
CHECK(gstats8.ob_freetile_active == 1);
CHECK(gstats8.ob_calls >= 9u);
CHECK(gstats8.ob_tiles_dispatched >= 9u);
CHECK(gstats8.ob_w_hits > gstats0.ob_w_hits);
CHECK(gstats8.ob_weight_cache_bytes > 0u);
CHECK(gstats8.freetpu_w_misses == gstats0.freetpu_w_misses);
CHECK(gstats8.freetpu_w_evictions == gstats0.freetpu_w_evictions);
CHECK(gstats8.freetpu_weight_pack_us == gstats0.freetpu_weight_pack_us);
if (gstats8.freetpu_emitter_active == 1) {
CHECK(gstats8.freetpu_freetile_active == 1);
CHECK(gstats8.freetpu_calls >= 9u);
CHECK(gstats8.freetpu_tiles_dispatched >= 9u);
CHECK(gstats8.freetpu_w_hits > gstats0.freetpu_w_hits);
CHECK(gstats8.freetpu_weight_cache_bytes > 0u);
}

/* Verify weight re-binding updates generation without stale cache hits */
Expand Down
40 changes: 20 additions & 20 deletions tools/pocketcoder_run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,44 +329,44 @@ int run_bench(const pc_run_options& opts) {
(void)pc_graph_step_bound(graph, x_step.data(), y_graph.data(), &gstats_end);
pc_graph_destroy(graph);

const uint64_t delta_misses = (gstats_end.ob_w_misses >= gstats_first.ob_w_misses)
? (gstats_end.ob_w_misses - gstats_first.ob_w_misses)
const uint64_t delta_misses = (gstats_end.freetpu_w_misses >= gstats_first.freetpu_w_misses)
? (gstats_end.freetpu_w_misses - gstats_first.freetpu_w_misses)
: 0u;
const uint64_t delta_evict = (gstats_end.ob_w_evictions >= gstats_first.ob_w_evictions)
? (gstats_end.ob_w_evictions - gstats_first.ob_w_evictions)
const uint64_t delta_evict = (gstats_end.freetpu_w_evictions >= gstats_first.freetpu_w_evictions)
? (gstats_end.freetpu_w_evictions - gstats_first.freetpu_w_evictions)
: 0u;
const uint64_t delta_pack_us = (gstats_end.ob_weight_pack_us >= gstats_first.ob_weight_pack_us)
? (gstats_end.ob_weight_pack_us - gstats_first.ob_weight_pack_us)
const uint64_t delta_pack_us = (gstats_end.freetpu_weight_pack_us >= gstats_first.freetpu_weight_pack_us)
? (gstats_end.freetpu_weight_pack_us - gstats_first.freetpu_weight_pack_us)
: 0u;

std::printf("PocketCoder-13B-A3B Micro-Benchmark [%s, %ux%u, backend=%s, iters=%u, mode=%s]\n",
src_label, n_dim, k_dim, pc_soa_kernel_backend_name(), iters,
opts.mock_mode ? "mock" : (gstats_end.ob_hw_active ? "live-hw" : "live-fallback"));
opts.mock_mode ? "mock" : (gstats_end.freetpu_hw_active ? "live-hw" : "live-fallback"));
std::printf("Parity vs FP32 ref: SoA-F32 max_abs=%.3e nmse=%.3e | SoA-SDOT max_abs=%.3e nmse=%.3e\n",
p_f32.max_abs_err, p_f32.nmse, p_sdot.max_abs_err, p_sdot.nmse);
std::printf("DSpark (MAX_DUP=4): %u -> %u unique experts (%.2fx dedup, %.2f MB saved/layer)\n",
dplan.naive_expert_loads, dplan.dedup_expert_loads, dplan.dedup_ratio,
static_cast<double>(dplan.bytes_saved) / (1024.0 * 1024.0));
std::printf(
"DMA-BUF graph: zero_copy=%d min_align=%zu handoffs=%llu fallback_copies=%llu "
"hw_active=%d emitter=%d freetile=%d ob_calls=%llu ob_tiles=%llu ob_hw_us=%llu "
"hw_active=%d emitter=%d freetile=%d freetpu_calls=%llu freetpu_tiles=%llu freetpu_hw_us=%llu "
"w_hits=%llu w_misses=%llu(delta=%llu) w_evict=%llu(delta=%llu) pack_us=%llu(delta=%llu) "
"w_bytes=%llu nmse=%.3e\n\n",
gstats_end.reconciled_zero_copy, gstats_end.reconciled_min_align,
static_cast<unsigned long long>(gstats_end.zero_copy_handoffs),
static_cast<unsigned long long>(gstats_end.fallback_copies),
gstats_end.ob_hw_active, gstats_end.ob_emitter_active, gstats_end.ob_freetile_active,
static_cast<unsigned long long>(gstats_end.ob_calls),
static_cast<unsigned long long>(gstats_end.ob_tiles_dispatched),
static_cast<unsigned long long>(gstats_end.ob_hw_us),
static_cast<unsigned long long>(gstats_end.ob_w_hits),
static_cast<unsigned long long>(gstats_end.ob_w_misses),
gstats_end.freetpu_hw_active, gstats_end.freetpu_emitter_active, gstats_end.freetpu_freetile_active,
static_cast<unsigned long long>(gstats_end.freetpu_calls),
static_cast<unsigned long long>(gstats_end.freetpu_tiles_dispatched),
static_cast<unsigned long long>(gstats_end.freetpu_hw_us),
static_cast<unsigned long long>(gstats_end.freetpu_w_hits),
static_cast<unsigned long long>(gstats_end.freetpu_w_misses),
static_cast<unsigned long long>(delta_misses),
static_cast<unsigned long long>(gstats_end.ob_w_evictions),
static_cast<unsigned long long>(gstats_end.freetpu_w_evictions),
static_cast<unsigned long long>(delta_evict),
static_cast<unsigned long long>(gstats_end.ob_weight_pack_us),
static_cast<unsigned long long>(gstats_end.freetpu_weight_pack_us),
static_cast<unsigned long long>(delta_pack_us),
static_cast<unsigned long long>(gstats_end.ob_weight_cache_bytes),
static_cast<unsigned long long>(gstats_end.freetpu_weight_cache_bytes),
gstats_end.nmse);

std::printf("| Metric | Baseline (Scalar SoA) | Now (NEON SoA F32) | Now (NEON SoA sdot) | How measured |\n");
Expand All @@ -378,16 +378,16 @@ int run_bench(const pc_run_options& opts) {
std::printf("| Effective Weight BW | %.2f GB/s | %.2f GB/s | %.2f GB/s | (scales+qs+x)/median_us |\n",
bw_ctrl, bw_f32, bw_sdot);
std::printf("| Pre-baked Bound Step %ux%u | - | %.2f us median | hw=%d emitter=%d | pc_graph_step_bound (%u iters) |\n",
n_dim, k_dim, graph_bound_us, gstats_end.ob_hw_active, gstats_end.ob_emitter_active,
n_dim, k_dim, graph_bound_us, gstats_end.freetpu_hw_active, gstats_end.freetpu_emitter_active,
std::min<uint32_t>(iters, 20u));

pc_soa_free(&mat);
if (gf) {
pc_gguf_close(gf);
}
const double graph_nmse_limit = gstats_end.ob_hw_active ? 5e-3 : 1e-10;
const double graph_nmse_limit = gstats_end.freetpu_hw_active ? 5e-3 : 1e-10;
const bool dmabuf_ok = (gstats_end.fallback_copies == 0u) ||
(!opts.mock_mode && !opts.strict_hw && gstats_end.ob_hw_active == 0);
(!opts.mock_mode && !opts.strict_hw && gstats_end.freetpu_hw_active == 0);
const bool zero_repack_ok = (delta_misses == 0u && delta_evict == 0u && delta_pack_us == 0u);
const bool graph_parity_ok = (gstats_first.nmse < graph_nmse_limit && gstats_end.nmse < graph_nmse_limit);
return (p_f32.nmse < 1e-10 && p_sdot.nmse < 1e-2 && dmabuf_ok &&
Expand Down
70 changes: 35 additions & 35 deletions tools/volcanic_tpu_dmabuf_bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Volcanic GPU, EdgeTPU, and CPU (linear layout, 128-byte aligned).
* 2. Imports the EXACT SAME DMA-BUF file descriptors into BOTH:
* - PowerVR Volcanic Vulkan via VK_EXT_external_memory_dma_buf (dup CLOEXEC fd)
* - Tensor G5 EdgeTPU via libfreetpu ob_dmabuf_map (36-bit IOVA, pinned once)
* - Tensor G5 EdgeTPU via libfreetpu freetpu_dmabuf_map (36-bit IOVA, pinned once)
* 3. Executes a 3-stage round-trip with 0 host copies and 0 hot-loop IOVA maps:
* Stage 1 (Volcanic GPU SPIR-V) : Prefill GEMM H[M, K] = X @ W_gpu^T -> DecodeIn[K]
* Stage 2 (EdgeTPU W8A16 IOVA) : Decode MUL_MAT Y_raw[N] = FP16(DecodeIn) @ W_tpu^T
Expand Down Expand Up @@ -1264,22 +1264,22 @@ int main(int argc, char** argv) {
}

/* 3. Initialize libfreetpu EdgeTPU and map the EXACT SAME b_mid & b_tpu_out FDs ONCE! */
ob_config_t ob_cfg = ob_config_default();
ob_cfg.mock_mode = 0;
ob_cfg.dma_heap_path = heap_path;
ob_cfg.perf_mode = 5u;

ob_context_t* ob_ctx = nullptr;
if (ob_context_create(&ob_cfg, &ob_ctx) != OB_OK || !ob_ctx) {
std::fprintf(stderr, "ob_context_create failed\n");
freetpu_config_t ft_cfg = freetpu_config_default();
ft_cfg.mock_mode = 0;
ft_cfg.dma_heap_path = heap_path;
ft_cfg.perf_mode = 5u;

freetpu_context_t* ft_ctx = nullptr;
if (freetpu_context_create(&ft_cfg, &ft_ctx) != FREETPU_OK || !ft_ctx) {
std::fprintf(stderr, "freetpu_context_create failed\n");
vk.shutdown();
fs_context_destroy(fctx);
return 1;
}
if (ob_gemm_register_builtin_emitter(ob_ctx, dive_path) != OB_OK) {
std::fprintf(stderr, "ob_gemm_register_builtin_emitter failed: %s\n",
ob_context_last_error(ob_ctx));
ob_context_destroy(ob_ctx);
if (freetpu_gemm_register_builtin_emitter(ft_ctx, dive_path) != FREETPU_OK) {
std::fprintf(stderr, "freetpu_gemm_register_builtin_emitter failed: %s\n",
freetpu_context_last_error(ft_ctx));
freetpu_context_destroy(ft_ctx);
vk.shutdown();
fs_context_destroy(fctx);
return 1;
Expand All @@ -1297,10 +1297,10 @@ int main(int argc, char** argv) {
(out_fd_len > 0 && static_cast<size_t>(out_fd_len) >= b_tpu_out->size)
? static_cast<uint64_t>(out_fd_len)
: static_cast<uint64_t>(b_tpu_out->size);
if (ob_dmabuf_map(ob_ctx, b_mid->dmabuf_fd, 0u, mid_map_sz, OB_BUF_BIDIRECTIONAL, &mid_iova) != OB_OK ||
ob_dmabuf_map(ob_ctx, b_tpu_out->dmabuf_fd, 0u, out_map_sz, OB_BUF_BIDIRECTIONAL, &tpu_out_iova) != OB_OK) {
std::fprintf(stderr, "ob_dmabuf_map failed: %s\n", ob_context_last_error(ob_ctx));
ob_context_destroy(ob_ctx);
if (freetpu_dmabuf_map(ft_ctx, b_mid->dmabuf_fd, 0u, mid_map_sz, FREETPU_BUF_BIDIRECTIONAL, &mid_iova) != FREETPU_OK ||
freetpu_dmabuf_map(ft_ctx, b_tpu_out->dmabuf_fd, 0u, out_map_sz, FREETPU_BUF_BIDIRECTIONAL, &tpu_out_iova) != FREETPU_OK) {
std::fprintf(stderr, "freetpu_dmabuf_map failed: %s\n", freetpu_context_last_error(ft_ctx));
freetpu_context_destroy(ft_ctx);
vk.shutdown();
fs_context_destroy(fctx);
return 1;
Expand Down Expand Up @@ -1347,12 +1347,12 @@ int main(int argc, char** argv) {
const uint64_t t2 = now_ns();

/* Stage 2: EdgeTPU W8A16 MUL_MAT directly on mid_iova -> tpu_out_iova (0 host copies!) */
ob_invoke_stats_t tpu_st{};
ob_status_t ost = ob_gemm_matmul_f32_w8a16_dmabuf(
ob_ctx, mid_iova, sz_mid, h_w_tpu.data(), k_dim, n_dim, tpu_out_iova, sz_tpu_out, &tpu_st);
if (ost != OB_OK) {
std::fprintf(stderr, "ob_gemm_matmul_f32_w8a16_dmabuf failed: %s (%s)\n",
ob_status_string(ost), ob_context_last_error(ob_ctx));
freetpu_invoke_stats_t tpu_st{};
freetpu_status_t ost = freetpu_gemm_matmul_f32_w8a16_dmabuf(
ft_ctx, mid_iova, sz_mid, h_w_tpu.data(), k_dim, n_dim, tpu_out_iova, sz_tpu_out, &tpu_st);
if (ost != FREETPU_OK) {
std::fprintf(stderr, "freetpu_gemm_matmul_f32_w8a16_dmabuf failed: %s (%s)\n",
freetpu_status_string(ost), freetpu_context_last_error(ft_ctx));
goto fail_live;
}
const uint64_t t3 = now_ns();
Expand Down Expand Up @@ -1403,7 +1403,7 @@ int main(int argc, char** argv) {
const ParityMetrics par_tpu = compute_parity(got_tpu.data(), ref_tpu.data(), n_dim);
const ParityMetrics par_final = compute_parity(got_final.data(), ref_final.data(), n_dim);

/* 5. Host-Staged memcpy Baseline (exact same math via CPU staging copies + ob_gemm_matmul_f32_w8a16_tile) */
/* 5. Host-Staged memcpy Baseline (exact same math via CPU staging copies + freetpu_gemm_matmul_f32_w8a16_tile) */
std::vector<float> stage_mid(k_dim), stage_tpu_out(n_dim);
std::vector<double> base_handoff_us, base_tpu_wall_us, base_total_us;
base_handoff_us.reserve(iters);
Expand All @@ -1425,11 +1425,11 @@ int main(int argc, char** argv) {
const uint64_t t2 = now_ns();

/* Standard host-pointer EdgeTPU call (internally copies host -> TPU DMA-BUF -> host) */
ob_invoke_stats_t bst{};
if (ob_gemm_matmul_f32_w8a16_tile(ob_ctx, stage_mid.data(), h_w_tpu.data(), h_ones.data(),
k_dim, n_dim, stage_tpu_out.data(), &bst) != OB_OK) {
std::fprintf(stderr, "Baseline ob_gemm_matmul_f32_w8a16_tile failed: %s\n",
ob_context_last_error(ob_ctx));
freetpu_invoke_stats_t bst{};
if (freetpu_gemm_matmul_f32_w8a16_tile(ft_ctx, stage_mid.data(), h_w_tpu.data(), h_ones.data(),
k_dim, n_dim, stage_tpu_out.data(), &bst) != FREETPU_OK) {
std::fprintf(stderr, "Baseline freetpu_gemm_matmul_f32_w8a16_tile failed: %s\n",
freetpu_context_last_error(ft_ctx));
goto fail_live;
}
const uint64_t t3 = now_ns();
Expand Down Expand Up @@ -1538,9 +1538,9 @@ int main(int argc, char** argv) {
(has_pwr_before || has_pwr_after) ? 1 : 0, avg_pwr_mw, zc_mj_step);
}

(void)ob_dmabuf_unmap(ob_ctx, mid_iova);
(void)ob_dmabuf_unmap(ob_ctx, tpu_out_iova);
ob_context_destroy(ob_ctx);
(void)freetpu_dmabuf_unmap(ft_ctx, mid_iova);
(void)freetpu_dmabuf_unmap(ft_ctx, tpu_out_iova);
freetpu_context_destroy(ft_ctx);
vk.destroy_buffer(&vk_x);
vk.destroy_buffer(&vk_w_gpu);
vk.destroy_buffer(&vk_prefill);
Expand All @@ -1554,9 +1554,9 @@ int main(int argc, char** argv) {
}

fail_live:
(void)ob_dmabuf_unmap(ob_ctx, mid_iova);
(void)ob_dmabuf_unmap(ob_ctx, tpu_out_iova);
ob_context_destroy(ob_ctx);
(void)freetpu_dmabuf_unmap(ft_ctx, mid_iova);
(void)freetpu_dmabuf_unmap(ft_ctx, tpu_out_iova);
freetpu_context_destroy(ft_ctx);
vk.destroy_buffer(&vk_x);
vk.destroy_buffer(&vk_w_gpu);
vk.destroy_buffer(&vk_prefill);
Expand Down
Loading
Loading