[feat] model_config.summaries_set:训练期 PCOC 与 scalars TensorBoard 摘要#598
Open
fooSynaptic wants to merge 6 commits into
Open
[feat] model_config.summaries_set:训练期 PCOC 与 scalars TensorBoard 摘要#598fooSynaptic wants to merge 6 commits into
fooSynaptic wants to merge 6 commits into
Conversation
定义 summary.proto,在 ModelConfig 挂载 summaries_set,并实现训练期 累积均值与 PCOC/scalars 计算及单元测试。
BaseModel 初始化/更新/汇总训练 summary,main 在 log step 写入 summary/* tag; mock 配置增加 pcoc 示例。
mock 配置展示 pcoc(pred_name/label_name/epsilon)与 scalars 特征切片示例。
TrainSummaryModule 暴露 summary_cfg 属性;evaluation_metrics.md 增加 model_config.summaries_set 配置说明及分布式 rank-0 局部统计说明。
覆盖 mock 配置中 id_1 稀疏特征切片及 log step 间 running mean 累积逻辑。
模拟 mock 配置下多 batch 累积并校验 summary/* 标量写入 TensorBoard。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
model_config.summaries_set新增训练期 TensorBoard 摘要配置(来自 EasyRec issue:无法通过配置调整来增加 tensorboard监控)。log_step_count_steps累积 batch 级mean(pred)/mean(label),写入summary/pcoc、summary/predicted_ctr、summary/observed_ctr。feature_name+feature_value切片统计mean(pred),写入summary/<name>;pred_name为logits时自动 sigmoid。BaseModel,Rank/Match 等模型均可配置;multi_tower_din_mock.config含完整示例。docs/source/models/evaluation_metrics.md。配置示例
model_config { summaries_set { pcoc { pred_name: "probs" label_name: "clk" epsilon: 1e-7 } } summaries_set { scalars { name: "id_1_bucket_pred" pred_name: "probs" feature_name: "id_1" feature_value: "1005" } } }分布式说明
分布式训练时,各 rank 在本地累积摘要,仅 rank 0 写入 TensorBoard。
summary/*数值反映 rank 0 所见分片数据的统计,非全局 all-reduce 结果(与当前train_metrics行为一致)。Test plan
python3 tzrec/metrics/train_summary_test.py(6 项 CPU 测试,Apple Silicon M4 本地验证通过)multi_tower_din_mock.config的 pcoc + scalars,3 个 mini-batch 累积后写入 TensorBoard 并回读校验summary/*tagpython -m grpc_tools.protoc -I . tzrec/protos/*.proto tzrec/protos/models/*.proto --python_out=. --pyi_out=.生成summary_pb2.py