Unpack FL2VA sampler reference state
This commit is contained in:
parent
68606e1a30
commit
79bdce15e0
2 changed files with 22 additions and 5 deletions
|
|
@ -21,8 +21,12 @@ text = H3TokenRefiner(checkpoint)(Qwen3VLPromptConditioner("/text-encoders/qwen3
|
|||
model = H3PackedDenoiser.from_checkpoint(checkpoint, attention_backend="sage2").eval()
|
||||
packer = H3PromptPacker(checkpoint)
|
||||
|
||||
video, audio_carried = initial["initial_x"]
|
||||
video, audio_carried = video.to("cuda"), audio_carried.to("cuda")
|
||||
packed_initial = initial["initial_x"].to("cuda").reshape(-1)
|
||||
video_shape = (1, 24, 7, 12, 20)
|
||||
audio_shape = (1, 32, 2, 37)
|
||||
video_count = torch.tensor(video_shape).prod().item()
|
||||
video = packed_initial[:video_count].reshape(video_shape)
|
||||
audio_carried = packed_initial[video_count:].reshape(audio_shape)
|
||||
old_video = old_audio = old_sigma = None
|
||||
for index, reference in enumerate(steps):
|
||||
sigma, sigma_down = sigmas[index], sigmas[index + 1]
|
||||
|
|
@ -34,11 +38,13 @@ for index, reference in enumerate(steps):
|
|||
carry = _audio_sigma(sigma) / sigma
|
||||
velocity_audio = (1.0 - 4.0) * (audio_carried * carry) + (1.0 + 3.0 * _audio_sigma(sigma)) * velocity_audio
|
||||
denoised = (video - sigma * velocity_video, audio_carried - sigma * velocity_audio)
|
||||
reference_denoised = reference["denoised"]
|
||||
denoised_delta = (denoised[0].float() - reference_denoised[0].float()).abs()
|
||||
reference_denoised = reference["denoised"].to("cuda").reshape(-1)
|
||||
reference_denoised_video = reference_denoised[:video_count].reshape(video_shape)
|
||||
denoised_delta = (denoised[0].float() - reference_denoised_video.float()).abs()
|
||||
previous_sigma = sigmas[index - 1] if index else None
|
||||
video = res_multistep_update(video, denoised[0], sigma, sigma_down, old_video, old_sigma, previous_sigma)
|
||||
audio_carried = res_multistep_update(audio_carried, denoised[1], sigma, sigma_down, old_audio, old_sigma, previous_sigma)
|
||||
latent_delta = (video.float() - reference["x"][0].float()).abs()
|
||||
reference_latent = reference["x"].to("cuda").reshape(-1)[:video_count].reshape(video_shape)
|
||||
latent_delta = (video.float() - reference_latent.float()).abs()
|
||||
print(f"step={index:02d} x0_video_mean={denoised_delta.mean().item():.6g} x0_video_max={denoised_delta.max().item():.6g} latent_video_mean={latent_delta.mean().item():.6g} latent_video_max={latent_delta.max().item():.6g}")
|
||||
old_video, old_audio, old_sigma = denoised[0], denoised[1], sigma_down
|
||||
|
|
|
|||
11
tools/inspect_fl2va_initial.py
Normal file
11
tools/inspect_fl2va_initial.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import torch
|
||||
|
||||
|
||||
state = torch.load("/artifacts/fl2va-sampler-reference/initial.pt", map_location="cpu", weights_only=False)
|
||||
for name, value in state.items():
|
||||
print(name, type(value), getattr(value, "shape", None))
|
||||
if hasattr(value, "unbind"):
|
||||
try:
|
||||
print("unbind", [(type(item), getattr(item, "shape", None)) for item in value.unbind()])
|
||||
except Exception as error:
|
||||
print("unbind error", error)
|
||||
Loading…
Add table
Reference in a new issue