(&self, indices: &[usize])
| 503 | |
| 504 | #[cfg(unix)] |
| 505 | fn prefetch_experts(&self, indices: &[usize]) { |
| 506 | for &idx in indices { |
| 507 | if idx >= self.num_experts { |
| 508 | continue; |
| 509 | } |
| 510 | let names = &self.expert_names[idx]; |
| 511 | for name in [&names.gate_proj, &names.up_proj, &names.down_proj] { |
| 512 | if let Some((bytes, _, _)) = self.storage.tensor_bytes(name) { |
| 513 | unsafe { |
| 514 | libc::madvise( |
| 515 | bytes.as_ptr() as *mut libc::c_void, |
| 516 | bytes.len(), |
| 517 | libc::MADV_WILLNEED, |
| 518 | ); |
| 519 | } |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | impl DiskExpertProvider { |
nothing calls this directly
no test coverage detected