// The weight store (see cublas.bend): Wt.load, Wt.park, Wt.fetch, Wt.drop, Wt.budget, Wt.ready, Wt.free, Gemm.i8w and // Gemm.f32w. Uses Bend runtime internals (e.mem, blk_loc, gpu_dev). #include #include #include #include #if BEND_CUDA // A weight is either loaded (its bytes live on the GPU until Wt.free) or parked (its bytes live in pinned host memory, // and Wt.fetch / Wt.drop put a GPU copy in place and take it away again, as often as needed). #define WT_MAX 4096 typedef struct { CUdeviceptr ptr; // the GPU copy (0: none) uint64_t bytes; // bytes on the GPU (and in host memory, for a parked weight) int f32; // widened to F32 int parked; // 1: the bytes live in `host` char* host; // pinned host copy of a parked weight uint64_t seq; // the queue job that last put this weight's bytes in place (load, park or fetch) int fetched; // a parked weight with a fetch queued and no drop since CUevent ready; // recorded on the copy stream after that job's last copy int live; // not freed } WtEnt; static WtEnt wt_tab[WT_MAX]; static uint32_t wt_count; typedef int (*WtCreate)(void**); typedef int (*WtSgemm)(void*, int, int, int, int, int, const float*, const float*, int, const float*, int, const float*, float*, int); typedef int (*WtGemmEx)(void*, int, int, int, int, int, const void*, const void*, int, int, const void*, int, int, const void*, void*, int, int, int, int); static struct { int state; void* handle; WtGemmEx gemm; WtSgemm sgemm; const char* why; } wt_lib; static void wt_die(const char* what) { fprintf(stderr, "%s\n", what); exit(1); } static void wt_ctx(void) { CUcontext ctx; if (cuDevicePrimaryCtxRetain(&ctx, gpu_dev) != CUDA_SUCCESS || cuCtxSetCurrent(ctx) != CUDA_SUCCESS) wt_die("Wt: no CUDA context"); } static void wt_open(void) { if (wt_lib.state != 0) return; wt_lib.state = -1; char path[512]; const char* home = getenv("CUDA_HOME"); void* h = NULL; if (home != NULL) { snprintf(path, sizeof path, "%s/lib64/libcublas.so", home); h = dlopen(path, RTLD_NOW | RTLD_GLOBAL); } if (h == NULL) h = dlopen("/usr/local/cuda/lib64/libcublas.so", RTLD_NOW | RTLD_GLOBAL); if (h == NULL) h = dlopen("libcublas.so", RTLD_NOW | RTLD_GLOBAL); if (h == NULL) { wt_lib.why = "libcublas.so not found"; return; } WtCreate create = (WtCreate)dlsym(h, "cublasCreate_v2"); wt_lib.gemm = (WtGemmEx)dlsym(h, "cublasGemmEx"); wt_lib.sgemm = (WtSgemm)dlsym(h, "cublasSgemm_v2"); if (create == NULL || wt_lib.gemm == NULL || wt_lib.sgemm == NULL) { wt_lib.why = "cuBLAS symbols missing"; return; } wt_ctx(); if (create(&wt_lib.handle) != 0) { wt_lib.why = "cublasCreate failed"; return; } wt_lib.state = 1; } // One worker thread takes a queue of jobs in order: // - load: read a weight from its file into its GPU buffer. Each 16 MB chunk is read by WT_THREADS threads at once // (pread) into one of two pinned staging buffers, widened there in parallel when the weights are bf16 or fp16, and // copied to the GPU asynchronously, so reading the next chunk overlaps copying this one. // - park: read a weight into its pinned host copy the same way (straight into it when it is not widened). // - fetch: copy a parked weight to a new GPU buffer, once the fetched bytes not yet dropped leave room under the // budget. The copy goes in 4 MB pieces with at most two in flight: the Bend runtime and these effects wait for the // whole GPU (cuCtxSynchronize) after each kernel, copies on other streams included, so a large copy in flight would // stall every kernel behind it. // After a job's last copy the worker records the weight's `ready` event. A GEMM, Wt.drop or Wt.free waits only for its // own weight: until the worker has queued that job's copies, then, on the GPU, for the event. #define WT_CHUNK (16ull << 20) #define WT_FCHUNK (4ull << 20) #define WT_THREADS 16 #define WT_Q 16384 enum { WT_LOAD, WT_PARK, WT_FETCH }; typedef struct { int kind; uint32_t id; char* path; uint64_t off, bytes; int mode; } WtJob; static struct { int ready; char* buf[2]; uint32_t* wide[2]; CUstream st; CUevent ev[2]; int busy[2]; } wt_io; static struct { pthread_mutex_t mu; pthread_cond_t cv; pthread_t th; int started; uint64_t next, queued, done; // jobs taken, queued and finished (job k lives at job[k % WT_Q]) WtJob job[WT_Q]; uint64_t budget, used; // GPU bytes allowed for fetched copies, and held by them now CUevent drop_ev; int dropped; // recorded on the legacy stream after each drop's free CUmemoryPool pool; } wt_q = {PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, .budget = 4ull << 30}; static void wt_io_init(void) { if (wt_io.ready) return; for (int i = 0; i < 2; i++) { if (cuMemHostAlloc((void**)&wt_io.buf[i], WT_CHUNK, 0) != CUDA_SUCCESS || cuMemHostAlloc((void**)&wt_io.wide[i], 2 * WT_CHUNK, 0) != CUDA_SUCCESS || cuEventCreate(&wt_io.ev[i], CU_EVENT_DISABLE_TIMING) != CUDA_SUCCESS) wt_die("Wt: cannot allocate pinned staging buffers"); } if (cuStreamCreate(&wt_io.st, CU_STREAM_NON_BLOCKING) != CUDA_SUCCESS) wt_die("Wt: no stream"); if (cuEventCreate(&wt_q.drop_ev, CU_EVENT_DISABLE_TIMING) != CUDA_SUCCESS) wt_die("Wt: no event"); // fetched copies come from the device's default memory pool, told to keep freed memory for the next fetch if (cuDeviceGetDefaultMemPool(&wt_q.pool, gpu_dev) != CUDA_SUCCESS) wt_die("Wt: no memory pool"); cuuint64_t keep = ~0ull; cuMemPoolSetAttribute(wt_q.pool, CU_MEMPOOL_ATTR_RELEASE_THRESHOLD, &keep); wt_io.ready = 1; } // waits until weight id's last job has queued its copies, then makes the legacy stream (cuBLAS's) wait for them static void wt_wait_id(uint32_t id) { pthread_mutex_lock(&wt_q.mu); while (wt_q.done <= wt_tab[id].seq) pthread_cond_wait(&wt_q.cv, &wt_q.mu); pthread_mutex_unlock(&wt_q.mu); if (cuStreamWaitEvent(CU_STREAM_LEGACY, wt_tab[id].ready, 0) != CUDA_SUCCESS) wt_die("Wt: copy failed"); } static uint64_t wt_push(WtJob jb) { pthread_mutex_lock(&wt_q.mu); while (wt_q.queued - wt_q.done >= WT_Q) pthread_cond_wait(&wt_q.cv, &wt_q.mu); uint64_t k = wt_q.queued; wt_q.job[k % WT_Q] = jb; wt_q.queued = k + 1; pthread_cond_broadcast(&wt_q.cv); pthread_mutex_unlock(&wt_q.mu); return k; } typedef struct { int fd; uint64_t off; char* dst; uint64_t n; int mode; uint32_t* wide; int ok; } WtPart; // one thread's slice of a chunk: read it, then widen it (mode 1: bf16, 2: fp16) into the F32 buffer static void* wt_part(void* arg) { WtPart* p = (WtPart*)arg; uint64_t got = 0; while (got < p->n) { ssize_t r = pread(p->fd, p->dst + got, p->n - got, (off_t)(p->off + got)); if (r <= 0) { p->ok = 0; return NULL; } got += (uint64_t)r; } if (p->mode == 1) { for (uint64_t i = 0; i < p->n / 2; i++) p->wide[i] = (uint32_t)((uint16_t*)p->dst)[i] << 16; } else if (p->mode == 2) { for (uint64_t i = 0; i < p->n / 2; i++) { float v = (float)((_Float16*)p->dst)[i]; memcpy(&p->wide[i], &v, 4); } } p->ok = 1; return NULL; } // reads n bytes at file offset off with WT_THREADS threads into dst, widening into wide when mode != 0 static void wt_read(int fd, const char* path, uint64_t off, uint64_t n, char* dst, int mode, uint32_t* wide) { WtPart parts[WT_THREADS]; pthread_t th[WT_THREADS]; uint64_t slice = ((n / WT_THREADS) + 4095) & ~4095ull; int used = 0; for (uint64_t s0 = 0; s0 < n && used < WT_THREADS; s0 += slice, used++) { uint64_t m = n - s0 < slice ? n - s0 : slice; parts[used] = (WtPart){fd, off + s0, dst + s0, m, mode, wide + s0 / 2, 0}; if (pthread_create(&th[used], NULL, wt_part, &parts[used]) != 0) wt_die("Wt: no thread"); } for (int i = 0; i < used; i++) pthread_join(th[i], NULL); for (int i = 0; i < used; i++) if (!parts[i].ok) { fprintf(stderr, "Wt: short read of %s at %llu\n", path, (unsigned long long)parts[i].off); exit(1); } } static void wt_slot_wait(int b) { if (wt_io.busy[b] && cuEventSynchronize(wt_io.ev[b]) != CUDA_SUCCESS) wt_die("Wt: copy failed"); wt_io.busy[b] = 0; } static void wt_copy(CUdeviceptr d, const void* src, uint64_t n, int b) { if (cuMemcpyHtoDAsync(d, src, n, wt_io.st) != CUDA_SUCCESS || cuEventRecord(wt_io.ev[b], wt_io.st) != CUDA_SUCCESS) wt_die("Wt: copy failed"); wt_io.busy[b] = 1; } static void wt_run_load(WtJob* jb) { WtEnt* w = &wt_tab[jb->id]; int wide = jb->mode != 0; int fd = open(jb->path, O_RDONLY); if (fd < 0) { fprintf(stderr, "Wt: cannot open %s\n", jb->path); exit(1); } int b = 0; for (uint64_t at = 0; at < jb->bytes; at += WT_CHUNK, b ^= 1) { uint64_t n = jb->bytes - at < WT_CHUNK ? jb->bytes - at : WT_CHUNK; if (jb->kind == WT_PARK && !wide) { // straight into the pinned host copy wt_read(fd, jb->path, jb->off + at, n, w->host + at, 0, NULL); continue; } wt_slot_wait(b); wt_read(fd, jb->path, jb->off + at, n, wt_io.buf[b], jb->mode, wt_io.wide[b]); void* src = wide ? (void*)wt_io.wide[b] : (void*)wt_io.buf[b]; if (jb->kind == WT_PARK) memcpy(w->host + (wide ? at * 2 : at), src, wide ? n * 2 : n); else wt_copy(w->ptr + (wide ? at * 2 : at), src, wide ? n * 2 : n, b); } if (cuEventRecord(w->ready, wt_io.st) != CUDA_SUCCESS) wt_die("Wt: copy failed"); close(fd); free(jb->path); } static void wt_run_fetch(WtJob* jb) { WtEnt* w = &wt_tab[jb->id]; pthread_mutex_lock(&wt_q.mu); while (wt_q.used > 0 && wt_q.used + w->bytes > wt_q.budget) pthread_cond_wait(&wt_q.cv, &wt_q.mu); wt_q.used += w->bytes; int dropped = wt_q.dropped; pthread_mutex_unlock(&wt_q.mu); // memory a drop freed is reused only after the GPU work queued before that drop if (dropped && cuStreamWaitEvent(wt_io.st, wt_q.drop_ev, 0) != CUDA_SUCCESS) wt_die("Wt.fetch: wait failed"); CUdeviceptr d; if (cuMemAllocFromPoolAsync(&d, w->bytes, wt_q.pool, wt_io.st) != CUDA_SUCCESS) { fprintf(stderr, "Wt.fetch: cannot allocate %llu bytes on the GPU\n", (unsigned long long)w->bytes); exit(1); } int b = 0; for (uint64_t at = 0; at < w->bytes; at += WT_FCHUNK, b ^= 1) { uint64_t n = w->bytes - at < WT_FCHUNK ? w->bytes - at : WT_FCHUNK; wt_slot_wait(b); wt_copy(d + at, w->host + at, n, b); } if (cuEventRecord(w->ready, wt_io.st) != CUDA_SUCCESS) wt_die("Wt.fetch: copy failed"); w->ptr = d; } static void* wt_worker(void* arg) { wt_ctx(); for (;;) { pthread_mutex_lock(&wt_q.mu); while (wt_q.next >= wt_q.queued) pthread_cond_wait(&wt_q.cv, &wt_q.mu); WtJob jb = wt_q.job[wt_q.next % WT_Q]; wt_q.next++; pthread_mutex_unlock(&wt_q.mu); if (jb.kind == WT_FETCH) wt_run_fetch(&jb); else wt_run_load(&jb); pthread_mutex_lock(&wt_q.mu); wt_q.done++; pthread_cond_broadcast(&wt_q.cv); pthread_mutex_unlock(&wt_q.mu); } return NULL; } static void wt_start(void) { wt_ctx(); wt_io_init(); pthread_mutex_lock(&wt_q.mu); if (!wt_q.started) { if (pthread_create(&wt_q.th, NULL, wt_worker, NULL) != 0) wt_die("Wt: no worker thread"); wt_q.started = 1; } pthread_mutex_unlock(&wt_q.mu); } static void* wt_cells(Env e, Term a, uint64_t need, const char* name) { if (term_tag(a) != TAG_BUF) { fprintf(stderr, "Gemm.i8w: %s is not a 32-bit array\n", name); exit(1); } if ((1ull << blk_cls(a)) < need) { fprintf(stderr, "Gemm.i8w: %s holds %llu cells, needs %llu\n", name, (unsigned long long)(1ull << blk_cls(a)), (unsigned long long)need); exit(1); } void* p = (void*)(e.mem + blk_loc(e.mem, a)); unsigned int managed = 0; if (cuPointerGetAttribute(&managed, CU_POINTER_ATTRIBUTE_IS_MANAGED, (CUdeviceptr)(uintptr_t)p) != CUDA_SUCCESS || !managed) { fprintf(stderr, "Gemm.i8w: %s is not in CUDA managed memory\n", name); exit(1); } return p; } static WtEnt* wt_ent(uint32_t id, const char* who) { if (id >= wt_count || !wt_tab[id].live) { fprintf(stderr, "%s: no weight %u\n", who, id); exit(1); } return &wt_tab[id]; } // the GPU copy of a weight, waited for: loaded, or parked and fetched static CUdeviceptr wt_gpu(uint32_t id, const char* who, int f32, uint64_t bytes) { WtEnt* w = wt_ent(id, who); if (w->f32 != f32) { fprintf(stderr, "%s: weight %u is %s\n", who, id, w->f32 ? "F32" : "int8"); exit(1); } if (w->parked && !w->fetched) { fprintf(stderr, "%s: weight %u is parked and not fetched\n", who, id); exit(1); } if (w->bytes != bytes) { fprintf(stderr, "%s: weight %u holds %llu bytes, the shape needs %llu\n", who, id, (unsigned long long)w->bytes, (unsigned long long)bytes); exit(1); } wt_wait_id(id); return w->ptr; } #endif // kind WT_LOAD or WT_PARK; mode 0: int8 as is; 1: bf16 -> F32; 2: fp16 -> F32 static Term wt_add(Env e, Term* f, int kind, int mode) { #if BEND_CUDA uint64_t len; char* path = io_cstr(e, f[0], &len); uint64_t off = ((uint64_t)(uint32_t)f[1] << 32) | (uint32_t)f[2]; uint64_t bytes = (uint32_t)f[3]; if (wt_count >= WT_MAX) { fprintf(stderr, "Wt: more than %d weights\n", WT_MAX); exit(1); } if (mode != 0 && bytes % 2 != 0) wt_die("Wt: odd byte count for a 16-bit weight"); wt_start(); uint64_t dbytes = mode != 0 ? bytes * 2 : bytes; uint32_t id = wt_count++; WtEnt* w = &wt_tab[id]; *w = (WtEnt){0, dbytes, mode != 0, kind == WT_PARK, NULL, 0, 0, NULL, 1}; if (cuEventCreate(&w->ready, CU_EVENT_DISABLE_TIMING) != CUDA_SUCCESS) wt_die("Wt: no event"); if (kind == WT_LOAD) { if (cuMemAlloc(&w->ptr, dbytes) != CUDA_SUCCESS) { fprintf(stderr, "Wt.load: cannot allocate %llu bytes on the GPU\n", (unsigned long long)dbytes); exit(1); } } else if (cuMemHostAlloc((void**)&w->host, dbytes, 0) != CUDA_SUCCESS) { fprintf(stderr, "Wt.park: cannot allocate %llu bytes of pinned host memory\n", (unsigned long long)dbytes); exit(1); } w->seq = wt_push((WtJob){kind, id, path, off, bytes, mode}); return (Term)id; #else fprintf(stderr, "Wt.load and Wt.park need a CUDA build\n"); exit(1); #endif } Term wt_load_run(Env e, Term* f, IoWork* w) { return wt_add(e, f, 0, 0); } Term wt_load_bf16_run(Env e, Term* f, IoWork* w) { return wt_add(e, f, 0, 1); } Term wt_load_f16_run(Env e, Term* f, IoWork* w) { return wt_add(e, f, 0, 2); } Term wt_park_run(Env e, Term* f, IoWork* w) { return wt_add(e, f, 1, 0); } Term wt_park_bf16_run(Env e, Term* f, IoWork* w) { return wt_add(e, f, 1, 1); } Term wt_park_f16_run(Env e, Term* f, IoWork* w) { return wt_add(e, f, 1, 2); } Term wt_fetch_run(Env e, Term* f, IoWork* w) { #if BEND_CUDA uint32_t id = (uint32_t)f[0]; WtEnt* t = wt_ent(id, "Wt.fetch"); if (!t->parked) { fprintf(stderr, "Wt.fetch: weight %u is not parked\n", id); exit(1); } if (t->fetched) { fprintf(stderr, "Wt.fetch: weight %u is already fetched\n", id); exit(1); } t->fetched = 1; t->seq = wt_push((WtJob){WT_FETCH, id, NULL, 0, 0, 0}); #endif return term_pak(CID(Unit), 0); } Term wt_drop_run(Env e, Term* f, IoWork* w) { #if BEND_CUDA uint32_t id = (uint32_t)f[0]; WtEnt* t = wt_ent(id, "Wt.drop"); if (!t->fetched) { fprintf(stderr, "Wt.drop: weight %u is not fetched\n", id); exit(1); } wt_wait_id(id); // freed in stream order: after the GPU work already queued on the legacy stream (the GEMMs that read it) if (cuMemFreeAsync(t->ptr, CU_STREAM_LEGACY) != CUDA_SUCCESS || cuEventRecord(wt_q.drop_ev, CU_STREAM_LEGACY) != CUDA_SUCCESS) wt_die("Wt.drop: free failed"); t->ptr = 0; t->fetched = 0; pthread_mutex_lock(&wt_q.mu); wt_q.used -= t->bytes; wt_q.dropped = 1; pthread_cond_broadcast(&wt_q.cv); pthread_mutex_unlock(&wt_q.mu); #endif return term_pak(CID(Unit), 0); } Term wt_budget_run(Env e, Term* f, IoWork* w) { #if BEND_CUDA pthread_mutex_lock(&wt_q.mu); wt_q.budget = (uint64_t)(uint32_t)f[0] << 20; pthread_cond_broadcast(&wt_q.cv); pthread_mutex_unlock(&wt_q.mu); #endif return term_pak(CID(Unit), 0); } // waits until every job queued so far is done and its copies have reached the GPU Term wt_ready_run(Env e, Term* f, IoWork* w) { #if BEND_CUDA if (wt_q.started) { pthread_mutex_lock(&wt_q.mu); uint64_t k = wt_q.queued; while (wt_q.done < k) pthread_cond_wait(&wt_q.cv, &wt_q.mu); pthread_mutex_unlock(&wt_q.mu); if (cuStreamSynchronize(wt_io.st) != CUDA_SUCCESS) wt_die("Wt.ready: copy failed"); } #endif return term_pak(CID(Unit), 0); } Term wt_free_run(Env e, Term* f, IoWork* w) { #if BEND_CUDA uint32_t id = (uint32_t)f[0]; WtEnt* t = wt_ent(id, "Wt.free"); wt_ctx(); wt_wait_id(id); if (cuStreamSynchronize(CU_STREAM_LEGACY) != CUDA_SUCCESS) wt_die("Wt.free: synchronize failed"); if (t->parked) { if (t->fetched) { cuMemFreeAsync(t->ptr, CU_STREAM_LEGACY); pthread_mutex_lock(&wt_q.mu); wt_q.used -= t->bytes; pthread_cond_broadcast(&wt_q.cv); pthread_mutex_unlock(&wt_q.mu); } cuMemFreeHost(t->host); } else { cuMemFree(t->ptr); } t->ptr = 0; t->host = NULL; t->fetched = 0; t->live = 0; #endif return term_pak(CID(Unit), 0); } Term gemm_f32w_run(Env e, Term* f, IoWork* w) { #if BEND_CUDA uint32_t id = (uint32_t)f[1], n = (uint32_t)f[3], m = (uint32_t)f[4], k = (uint32_t)f[5]; wt_open(); if (wt_lib.state != 1) { fprintf(stderr, "Gemm.f32w: %s\n", wt_lib.why); exit(1); } CUdeviceptr wp = wt_gpu(id, "Gemm.f32w", 1, (uint64_t)m * k * 4); float* a = wt_cells(e, f[0], (uint64_t)n * k, "A"); float* c = wt_cells(e, f[2], (uint64_t)n * m, "C"); float one = 1.0f, zero = 0.0f; int st = wt_lib.sgemm(wt_lib.handle, 1, 0, (int)m, (int)n, (int)k, &one, (const float*)(uintptr_t)wp, (int)k, a, (int)k, &zero, c, (int)m); if (st != 0) { fprintf(stderr, "Gemm.f32w: cublasSgemm status %d\n", st); exit(1); } if (cuCtxSynchronize() != CUDA_SUCCESS) wt_die("Gemm.f32w: synchronize failed"); return io_tup(e, f[0], f[2]); #else fprintf(stderr, "Gemm.f32w needs a CUDA build\n"); exit(1); #endif } Term gemm_i8w_run(Env e, Term* f, IoWork* w) { #if BEND_CUDA uint32_t id = (uint32_t)f[1], n = (uint32_t)f[3], m = (uint32_t)f[4], k = (uint32_t)f[5]; if (k % 4 != 0) { fprintf(stderr, "Gemm.i8w: k = %u is not a multiple of 4\n", k); exit(1); } wt_open(); if (wt_lib.state != 1) { fprintf(stderr, "Gemm.i8w: %s\n", wt_lib.why); exit(1); } CUdeviceptr wp = wt_gpu(id, "Gemm.i8w", 0, (uint64_t)m * k); void* a = wt_cells(e, f[0], (uint64_t)n * k / 4, "A"); void* c = wt_cells(e, f[2], (uint64_t)n * m, "C"); int one = 1, zero = 0; int st = wt_lib.gemm(wt_lib.handle, 1, 0, (int)m, (int)n, (int)k, &one, (void*)(uintptr_t)wp, 3, (int)k, a, 3, (int)k, &zero, c, 10, (int)m, 72, -1); if (st != 0) { fprintf(stderr, "Gemm.i8w: cublasGemmEx status %d\n", st); exit(1); } if (cuCtxSynchronize() != CUDA_SUCCESS) wt_die("Gemm.i8w: synchronize failed"); return io_tup(e, f[0], f[2]); #else fprintf(stderr, "Gemm.i8w needs a CUDA build\n"); exit(1); #endif } static void __attribute__((constructor)) wt_use(void) { #ifdef CID(Wt.load) io_eff(CID(Wt.load), wt_load_run); #endif #ifdef CID(Gemm.i8w) io_eff(CID(Gemm.i8w), gemm_i8w_run); #endif #ifdef CID(Wt.load_bf16) io_eff(CID(Wt.load_bf16), wt_load_bf16_run); #endif #ifdef CID(Wt.free) io_eff(CID(Wt.free), wt_free_run); #endif #ifdef CID(Wt.load_f16) io_eff(CID(Wt.load_f16), wt_load_f16_run); #endif #ifdef CID(Gemm.f32w) io_eff(CID(Gemm.f32w), gemm_f32w_run); #endif #ifdef CID(Wt.park) io_eff(CID(Wt.park), wt_park_run); #endif #ifdef CID(Wt.park_bf16) io_eff(CID(Wt.park_bf16), wt_park_bf16_run); #endif #ifdef CID(Wt.park_f16) io_eff(CID(Wt.park_f16), wt_park_f16_run); #endif #ifdef CID(Wt.fetch) io_eff(CID(Wt.fetch), wt_fetch_run); #endif #ifdef CID(Wt.drop) io_eff(CID(Wt.drop), wt_drop_run); #endif #ifdef CID(Wt.budget) io_eff(CID(Wt.budget), wt_budget_run); #endif #ifdef CID(Wt.ready) io_eff(CID(Wt.ready), wt_ready_run); #endif }