MCPcopy Create free account
hub / github.com/Niko1221/Strata / run_split

Method run_split

engine/src/kernels/cpu/pool.cpp:1578–1592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1576}
1577
1578void ExpertPool::run_split(ExpertJob* jobs, int n) {
1579 if (n <= 0) return;
1580 if (n > kMaxSplit || n_ == 1 || expert_oracle_q8_0_enabled()) { run(jobs, n); return; }
1581 const auto t0 = std::chrono::steady_clock::now();
1582 jobs_ = jobs;
1583 const int threads = n_ + (host_works_ ? 1 : 0);
1584 // about three tasks per thread in each phase, so the tail is short
1585 parts_a_ = (std::max)(1, (3 * threads + n - 1) / n);
1586 parts_b_ = parts_a_;
1587 run_phase(1, n * parts_a_);
1588 for (int e = 0; e < n; ++e) act_quant_q8_1(split_[(size_t) e].ff, FF, split_[(size_t) e].a2);
1589 run_phase(2, n * parts_b_);
1590 mode_ = 0;
1591 ms_drain_ += std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - t0).count();
1592}
1593
1594int ExpertPool::phase_tasks(int64_t rows) const {
1595 return tasks_ == 0 ? 3 * (n_ + (host_works_ ? 1 : 0)) : (int) (std::min)(rows, (int64_t) tasks_);

Callers 4

expert_pool_dispatchFunction · 0.45
expert_pool_dispatchFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 5

nowFunction · 0.70
act_quant_q8_1Function · 0.70
runFunction · 0.50
countMethod · 0.45

Tested by 1

mainFunction · 0.36