okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
98d1c8d4f
main
1diff --git a/sycl/include/strata/core/verify.hpp b/sycl/include/strata/core/verify.hpp 2index0db24e2 ..255e3ea 100644 3--- a/sycl/include/strata/core/verify.hpp 4+++ b/sycl/include/strata/core/verify.hpp 5@@ -192,6 +192,7 @@ private: 6 Verifier* next_ = nullptr; 7 void* next_user_ = nullptr; 8 bool ple_stage() const { return lb_ <= 1 && 1 < le_; } ///< holds layer 1, where the PLE block runs 9+ bool record_commit(std::string& err); 10 bool capture_commit(std::string& err); 11 int pending_commit_ = 0; ///< n_keep of a launched, unfinished commit (0: none) 12 std::chrono::steady_clock::time_point pending_commit_t0_{}; 13diff --git a/sycl/src/core/verify.cpp b/sycl/src/core/verify.cpp 14index038f4d4 ..c822711 100644 15--- a/sycl/src/core/verify.cpp 16+++ b/sycl/src/core/verify.cpp 17@@ -1200,8 +1200,7 @@ catch (sycl::exception const &exc) { 18 std::exit(1); 19 } 20 21-bool Verifier::capture_commit(std::string &err) try { 22- if (commit_exec_ != nullptr) return true; 23+bool Verifier::record_commit(std::string &err) { 24 using namespace strata::kernels; 25 const ModelGeometry& g = *g_; 26 SessionState& ss = *ss_; 27@@ -1211,10 +1210,6 @@ bool Verifier::capture_commit(std::string &err) try { 28 (uint64_t) g.ssm_conv_channels * (g.ssm_d_conv - 1); 29 const int64_t TS = (s.idx_block - 1) * ID; 30 const int64_t HS = (int64_t) NG_HIST * NG_HC_DIM; 31- if (DPCT_CHECK_ERROR(dpct::experimental::begin_recording(cs_)) != 0) { 32- err = "verify: begin commit capture failed"; 33- return false; 34- } 35 bool ok = true; 36 try { 37 copy_i32_from_mapped(commit_, m_commit_, 2 + MT, cs_); 38@@ -1251,6 +1246,17 @@ bool Verifier::capture_commit(std::string &err) try { 39 err = std::string("verify commit: ") + e.what(); 40 ok = false; 41 } 42+ return ok; 43+} 44+ 45+bool Verifier::capture_commit(std::string &err) try { 46+ if (std::getenv("STRATA_VERIFY_EAGER") != nullptr) return true; 47+ if (commit_exec_ != nullptr) return true; 48+ if (DPCT_CHECK_ERROR(dpct::experimental::begin_recording(cs_)) != 0) { 49+ err = "verify: begin commit capture failed"; 50+ return false; 51+ } 52+ const bool ok = record_commit(err); 53 dpct::experimental::command_graph_ptr graph = nullptr; 54 const dpct::err0 ce = 55 DPCT_CHECK_ERROR(dpct::experimental::end_recording(cs_, &graph)); 56@@ -1754,8 +1760,9 @@ bool Verifier::commit(int n_keep, std::string &err, bool wait) try { 57 h_commit_[1] = n_keep - 1; 58 for (int t = 0; t < max_t_; ++t) h_commit_[2 + t] = t < n_keep ? (int32_t) (last_pos0_ + t) : -1; 59 std::atomic_thread_fence(std::memory_order_seq_cst); 60- const dpct::err0 le = 61- DPCT_CHECK_ERROR((cs_)->ext_oneapi_graph(*commit_exec_)); 62+ const dpct::err0 le = (std::getenv("STRATA_VERIFY_EAGER") != nullptr) 63+ ? (record_commit(err) ? 0 : 1) 64+ : DPCT_CHECK_ERROR((cs_)->ext_oneapi_graph(*commit_exec_)); 65 /* 66 DPCT1009: SYCL reports errors using exceptions and does not use error 67 codes. Please replace the "get_error_string_dummy(...)" with a real