From 125b85ce68be54aae36d61b9026c59faba34e51b Mon Sep 17 00:00:00 2001 From: olivame Date: Mon, 9 Feb 2026 18:49:44 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0fs=5Fembed=20=E7=BC=93?= =?UTF-8?q?=E5=AD=98=EF=BC=8C=E6=94=B6=E7=9B=8A=E4=B8=8D=E6=98=8E=E6=98=BE?= =?UTF-8?q?=EF=BC=8C=E7=B2=BE=E5=BA=A6=E4=B8=8D=E9=99=8D=E4=BD=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/unifolm_wma/modules/networks/wma_model.py | 28 ++++++++++++------- .../case1/output.log | 24 ++++++++-------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/unifolm_wma/modules/networks/wma_model.py b/src/unifolm_wma/modules/networks/wma_model.py index cc7f4ba..96e9df7 100644 --- a/src/unifolm_wma/modules/networks/wma_model.py +++ b/src/unifolm_wma/modules/networks/wma_model.py @@ -688,6 +688,8 @@ class WMAModel(nn.Module): # Context precomputation cache self._ctx_cache_enabled = False self._ctx_cache = {} + # fs_embed cache + self._fs_embed_cache = None def forward(self, x: Tensor, @@ -789,16 +791,20 @@ class WMAModel(nn.Module): # Combine emb if self.fs_condition: - if fs is None: - fs = torch.tensor([self.default_fs] * b, - dtype=torch.long, - device=x.device) - fs_emb = timestep_embedding(fs, - self.model_channels, - repeat_only=False).type(x.dtype) - - fs_embed = self.fps_embedding(fs_emb) - fs_embed = fs_embed.repeat_interleave(repeats=t, dim=0) + if self._ctx_cache_enabled and self._fs_embed_cache is not None: + fs_embed = self._fs_embed_cache + else: + if fs is None: + fs = torch.tensor([self.default_fs] * b, + dtype=torch.long, + device=x.device) + fs_emb = timestep_embedding(fs, + self.model_channels, + repeat_only=False).type(x.dtype) + fs_embed = self.fps_embedding(fs_emb) + fs_embed = fs_embed.repeat_interleave(repeats=t, dim=0) + if self._ctx_cache_enabled: + self._fs_embed_cache = fs_embed emb = emb + fs_embed h = x.type(self.dtype) @@ -864,6 +870,7 @@ def enable_ctx_cache(model): if isinstance(m, WMAModel): m._ctx_cache_enabled = True m._ctx_cache = {} + m._fs_embed_cache = None # conditional_unet1d cache from unifolm_wma.models.diffusion_head.conditional_unet1d import ConditionalUnet1D for m in model.modules(): @@ -878,6 +885,7 @@ def disable_ctx_cache(model): if isinstance(m, WMAModel): m._ctx_cache_enabled = False m._ctx_cache = {} + m._fs_embed_cache = None from unifolm_wma.models.diffusion_head.conditional_unet1d import ConditionalUnet1D for m in model.modules(): if isinstance(m, ConditionalUnet1D): diff --git a/unitree_z1_dual_arm_cleanup_pencils/case1/output.log b/unitree_z1_dual_arm_cleanup_pencils/case1/output.log index cf173a3..4e28f0e 100644 --- a/unitree_z1_dual_arm_cleanup_pencils/case1/output.log +++ b/unitree_z1_dual_arm_cleanup_pencils/case1/output.log @@ -1,14 +1,14 @@ /mnt/ASC1637/miniconda3/envs/unifolm-wma-o/lib/python3.10/site-packages/lightning_fabric/__init__.py:29: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. __import__("pkg_resources").declare_namespace(__name__) -2026-02-09 18:16:36.491189: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. -2026-02-09 18:16:36.494639: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used. -2026-02-09 18:16:36.527202: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered -2026-02-09 18:16:36.527247: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered -2026-02-09 18:16:36.529027: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered -2026-02-09 18:16:36.537430: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used. -2026-02-09 18:16:36.537748: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. +2026-02-09 18:39:50.119842: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. +2026-02-09 18:39:50.123128: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used. +2026-02-09 18:39:50.156652: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered +2026-02-09 18:39:50.156708: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered +2026-02-09 18:39:50.158926: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered +2026-02-09 18:39:50.167779: I external/local_tsl/tsl/cuda/cudart_stub.cc:31] Could not find cuda drivers on your machine, GPU will not be used. +2026-02-09 18:39:50.168073: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 AVX512F AVX512_VNNI AVX512_BF16 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. -2026-02-09 18:16:37.281129: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT +2026-02-09 18:39:50.915144: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT [rank: 0] Global seed set to 123 /mnt/ASC1637/miniconda3/envs/unifolm-wma-o/lib/python3.10/site-packages/kornia/feature/lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead. @torch.cuda.amp.custom_fwd(cast_inputs=torch.float32) @@ -116,7 +116,7 @@ DEBUG:PIL.Image:Importing WmfImagePlugin DEBUG:PIL.Image:Importing XbmImagePlugin DEBUG:PIL.Image:Importing XpmImagePlugin DEBUG:PIL.Image:Importing XVThumbImagePlugin - 12%|█▎ | 1/8 [01:08<07:58, 68.38s/it] 25%|██▌ | 2/8 [02:13<06:37, 66.30s/it] 38%|███▊ | 3/8 [03:18<05:28, 65.67s/it] 50%|█████ | 4/8 [04:23<04:21, 65.40s/it] 62%|██████▎ | 5/8 [05:28<03:15, 65.23s/it] 75%|███████▌ | 6/8 [06:32<02:10, 65.12s/it] 88%|████████▊ | 7/8 [07:37<01:05, 65.02s/it] 100%|██████████| 8/8 [08:42<00:00, 65.02s/it] 100%|██████████| 8/8 [08:42<00:00, 65.35s/it] + 12%|█▎ | 1/8 [01:08<07:58, 68.38s/it] 25%|██▌ | 2/8 [02:13<06:38, 66.48s/it] 38%|███▊ | 3/8 [03:18<05:29, 65.83s/it] 50%|█████ | 4/8 [04:23<04:22, 65.52s/it] 62%|██████▎ | 5/8 [05:28<03:15, 65.33s/it] 75%|███████▌ | 6/8 [06:33<02:10, 65.23s/it] 88%|████████▊ | 7/8 [07:38<01:05, 65.12s/it] 100%|██████████| 8/8 [08:43<00:00, 65.08s/it] 100%|██████████| 8/8 [08:43<00:00, 65.44s/it] >>>>>>>>>>>>>>>>>>>>>>>> >>> Step 1: generating actions ... >>> Step 1: interacting with world model ... @@ -140,6 +140,6 @@ DEBUG:PIL.Image:Importing XVThumbImagePlugin >>> Step 7: interacting with world model ... >>>>>>>>>>>>>>>>>>>>>>>> -real 9m46.864s -user 7m43.579s -sys 0m44.897s +real 9m46.215s +user 7m39.209s +sys 0m43.740s