From 632c206546cf4750c9eb67bb8016e6fe1735d1e4 Mon Sep 17 00:00:00 2001 From: OwnerSunshine530 Date: Tue, 16 Jun 2026 13:17:44 +0800 Subject: [PATCH] =?UTF-8?q?final:=20precompute=5Frep=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=85=B3=20=E2=80=94=20=E8=AF=84=E6=B5=8B=E7=AB=AF=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=E6=9C=AA=E7=94=9F=E6=95=88+=E5=90=88=E8=A7=84?= =?UTF-8?q?=E7=81=B0=E5=8C=BA,=E9=94=81=E5=AE=9A=E5=B9=B2=E5=87=80?= =?UTF-8?q?=E7=9A=84~68?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- 代码/code/infer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/代码/code/infer.py b/代码/code/infer.py index eb83521..803fa2a 100644 --- a/代码/code/infer.py +++ b/代码/code/infer.py @@ -55,8 +55,9 @@ CONFIG = { "dedup_embedding": True, # True=查表前对sign去重(只查唯一值再展开),本地7.80->6.49s,AUC逐位等价 "sparse_pool": False, # True=用(段×唯一)稀疏矩阵乘做池化,避免materialize整个[M,512](段内高重复时省) "compile": False, # 是否 torch.compile(实测慢5×,勿开) - # OOM 已修(流式只加载测试用户+直接逐item算+算完释放),本地 --eval-precompute 验证通过。 - "precompute_rep": True, # True=load_model(不计时)流式预计算item的RepEncoder向量,跳过embedding层 + # 预计算在评测端两次未生效(先OOM异常、后静默回退,无日志难诊断)且属合规灰区。默认关。 + # 本地 --eval-precompute 可跑通(4.07s);需重试见 RISKS.md。默认=干净合规的 ~68。 + "precompute_rep": False, # True=load_model预计算RepEncoder向量跳过embedding层(评测端未生效+灰区) }