Skip to content

Commit

Permalink
Add obc counter for TS migration. (#125986)
Browse files Browse the repository at this point in the history
Summary: Since table caffe2_pytorch_usage_stats only has 1 day retention which renders it useless for TS migration purposes, we want to build a lightweight counter mechanism to collect usage data about torch jit APIs which can monitor the usage decline in the long term.

Test Plan: CI

Reviewed By: SherlockNoMad

Differential Revision: D57216847

Pull Request resolved: #125986
Approved by: https://github.com/gmagogsfm
  • Loading branch information
zhxchen17 authored and pytorchmergebot committed May 11, 2024
1 parent 7e92a2c commit 1115a25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion torch/csrc/jit/serialization/export_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void ScriptModuleSerializer::serialize(
const ExtraFilesMap& extra_files,
bool bytecode_format,
bool save_mobile_debug_info) {
C10_LOG_API_USAGE_ONCE("torch.script.save");
C10_LOG_API_USAGE_ONCE("torch.jit.save");
writeExtraFiles(module, extra_files);
// Serialize the model object
writeArchive(
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/jit/serialization/import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Module ScriptModuleDeserializer::deserialize(
// we populate the upgraders map before any load starts
populate_upgraders_graph_map();

C10_LOG_API_USAGE_ONCE("torch.script.load");
C10_LOG_API_USAGE_ONCE("torch.jit.load");
device_ = device;
// Load extra files.
for (const auto& kv : extra_files) {
Expand Down

0 comments on commit 1115a25

Please sign in to comment.