Commit Graph
45 Commits
Author SHA1 Message Date
generatedunixname1401739305002972 a51b9f498c Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/io_utils.py
Differential Revision: D103379401

fbshipit-source-id: b1f6613116dcec832dea098e67419e97d9a91f22
2026-05-01 15:54:41 -07:00
generatedunixname1401739305002972 5f8e0647a1 Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/io_utils.py
Differential Revision: D103174371

fbshipit-source-id: 3b418fc1689a3eee05cde64287a68ea02579f366
2026-04-30 10:01:09 -07:00
Minh Vu c5e788aaa7 Release CUDA caching pool in close_session to stop monotonic GPU memory climb
Summary:
`Sam3BasePredictor.close_session` already calls `gc.collect()` after
popping the session from `_all_inference_states`, but never tells
PyTorch to return the freed allocations to the device. PyTorch's
caching allocator keeps them in its per-process pool, so
`cuda.memory_reserved()` (and the production deployment metric
`dyno.twtask.gpu_memory_utilization_avg` derived from it) climbs
monotonically across long-running workloads even though the Python-side session is gone.

Change: in `sam3/model/sam3_base_predictor.py`, call
`torch.cuda.empty_cache()` after the existing `gc.collect()`, gated on
the same `run_gc_collect` flag so the no-collect path is unchanged.
Wrapped in `torch.cuda.is_available()` for the (rare) CPU test path.
`empty_cache()` causes a CUDA synchronization, so it has a small cost per close. The existing `run_gc_collect` flag already acknowledges this trade-off (`gc.collect()` is also non-free), and the default has always been True, so the call site contract is preserved.

Reviewed By: arpitkalla

Differential Revision: D103081459

fbshipit-source-id: 71da61d28b822f4af5dd5c72ffdeca0f542a8b97
2026-04-29 18:39:25 -07:00
generatedunixname1401739305002972 c97c893969 Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/test/test_io_utils.py
Differential Revision: D102578609

fbshipit-source-id: bfefceaad3e29999d3c73bc30b2508dafa5c60a4
2026-04-27 12:38:24 -07:00
generatedunixname1401739305002972 eef9c1e86a Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/sam3/model/io_utils.py
Differential Revision: D102576637

fbshipit-source-id: 76378a87b33ee16a736b79c32e312751a69913f0
2026-04-27 10:02:50 -07:00
generatedunixname1401739305002972 875ed6fa5a Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/test/test_io_utils.py
Differential Revision: D102507703

fbshipit-source-id: 77d76f5f50614b55a74b134e132d448368a3a97d
2026-04-26 03:15:30 -07:00
generatedunixname1401739305002972 e6f0eae47a Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/test/test_io_utils.py
Differential Revision: D102459561

fbshipit-source-id: 7884c3f6ff6f06160170202b47c501b85f77e993
2026-04-25 22:30:00 -07:00
Quan Tran c3a42ff674 SAM3 multi-GPU session as default
Summary:
Default to multi-GPUs to avoid OOM. CPU offload seems to not helping as it still need to copy back into memory for tracking

___

overriding_review_checks_triggers_an_audit_and_retroactive_review
Oncall Short Name: storytelling_ai_fsx_health

Differential Revision: D102039480

fbshipit-source-id: c3540efb984382756ead223f16b66f5d87bbeb0b
2026-04-24 10:21:30 -07:00
generatedunixname1401739305002972 7567e8028c Fix PYRE_MISSING_ANNOTATIONS issues in fbcode/deeplearning/projects/sam3_release/test/test_io_utils.py
Differential Revision: D102320245

fbshipit-source-id: c44cb4c6613356c6039140ccb0f56d92a1e84a2a
2026-04-24 04:43:37 -07:00
Quan Tran 2e0009e23f v3 code
Summary: better design between LLM and SAM3 due to the embedding issue of SAM3

Reviewed By: mchorton

Differential Revision: D101818594

fbshipit-source-id: b51c36defc6ed4adae5406e8eba31280e05cac9a
2026-04-21 22:27:16 -07:00