Skip to content

update seko ar rope#1222

Merged
llmc-reviewer merged 1 commit into
mainfrom
gsq/dev-seko-0703
Jul 3, 2026
Merged

update seko ar rope#1222
llmc-reviewer merged 1 commit into
mainfrom
gsq/dev-seko-0703

Conversation

@gushiqiao

Copy link
Copy Markdown
Contributor

No description provided.

@llmc-reviewer llmc-reviewer merged commit 823dcfd into main Jul 3, 2026
2 checks passed
@llmc-reviewer llmc-reviewer deleted the gsq/dev-seko-0703 branch July 3, 2026 08:36

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates configurations and scripts to use new model paths, adjusts parallel sequence size, and configures AR settings. It also introduces support for sink tokens and global end offsets in the RoPE cache logic in both PyTorch and Triton implementations. The review feedback highlights potential division-by-zero errors in both PyTorch and Triton when local_per_frame is zero, suggests avoiding tl.maximum on compile-time scalars to prevent Triton compilation issues, and recommends replacing hardcoded absolute paths in configuration files and scripts with portable paths.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +203 to 209
ref_frames = ref_tokens // local_per_frame
ref_frame_idx = position_idx // local_per_frame
gen_frame_idx = ref_frames + gen_idx // local_per_frame
frame_idx = torch.where(is_ref, ref_frame_idx, gen_frame_idx)
ref_spatial_idx = position_idx % local_per_frame
gen_spatial_idx = gen_idx % local_per_frame
spatial_idx = torch.where(is_ref, ref_spatial_idx, gen_spatial_idx)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

If local_per_frame is 0 (which can happen if num_new < frames or frames is 0), a ZeroDivisionError will be raised when computing ref_frames, ref_frame_idx, gen_frame_idx, ref_spatial_idx, and gen_spatial_idx. Guarding these computations with a check for local_per_frame > 0 prevents this runtime crash.

Suggested change
ref_frames = ref_tokens // local_per_frame
ref_frame_idx = position_idx // local_per_frame
gen_frame_idx = ref_frames + gen_idx // local_per_frame
frame_idx = torch.where(is_ref, ref_frame_idx, gen_frame_idx)
ref_spatial_idx = position_idx % local_per_frame
gen_spatial_idx = gen_idx % local_per_frame
spatial_idx = torch.where(is_ref, ref_spatial_idx, gen_spatial_idx)
if local_per_frame > 0:
ref_frames = ref_tokens // local_per_frame
ref_frame_idx = position_idx // local_per_frame
gen_frame_idx = ref_frames + gen_idx // local_per_frame
frame_idx = torch.where(is_ref, ref_frame_idx, gen_frame_idx)
ref_spatial_idx = position_idx % local_per_frame
gen_spatial_idx = gen_idx % local_per_frame
spatial_idx = torch.where(is_ref, ref_spatial_idx, gen_spatial_idx)
else:
frame_idx = torch.zeros_like(position_idx)
spatial_idx = torch.zeros_like(position_idx)

Comment on lines +383 to 389
ref_frames: tl.constexpr = ref_tokens // local_per_frame
ref_frame_idx = token_idx // local_per_frame
gen_frame_idx = ref_frames + gen_idx // local_per_frame
frame_idx = tl.where(is_ref, ref_frame_idx, gen_frame_idx)
ref_spatial_idx = token_idx % local_per_frame
gen_spatial_idx = gen_idx % local_per_frame
local_spatial_idx = tl.where(is_ref, ref_spatial_idx, gen_spatial_idx)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

If local_per_frame is 0, Triton compilation will fail with a compile-time division by zero error because ref_tokens and local_per_frame are both tl.constexpr. Since local_per_frame is a compile-time constant, we can use a Python conditional check if local_per_frame > 0: to safely guard these calculations and prevent compilation failures.

Suggested change
ref_frames: tl.constexpr = ref_tokens // local_per_frame
ref_frame_idx = token_idx // local_per_frame
gen_frame_idx = ref_frames + gen_idx // local_per_frame
frame_idx = tl.where(is_ref, ref_frame_idx, gen_frame_idx)
ref_spatial_idx = token_idx % local_per_frame
gen_spatial_idx = gen_idx % local_per_frame
local_spatial_idx = tl.where(is_ref, ref_spatial_idx, gen_spatial_idx)
if local_per_frame > 0:
ref_frames: tl.constexpr = ref_tokens // local_per_frame
ref_frame_idx = token_idx // local_per_frame
gen_frame_idx = ref_frames + gen_idx // local_per_frame
frame_idx = tl.where(is_ref, ref_frame_idx, gen_frame_idx)
ref_spatial_idx = token_idx % local_per_frame
gen_spatial_idx = gen_idx % local_per_frame
local_spatial_idx = tl.where(is_ref, ref_spatial_idx, gen_spatial_idx)
else:
frame_idx = token_idx * 0
local_spatial_idx = token_idx * 0

token_idx = token_start + token_head_idx
local_token_idx = token_start + token_head_idx
range_end = token_start + seq_len
recent_local_tokens = tl.maximum(range_end - sink_tokens, 0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using tl.maximum on purely compile-time scalar values (range_end and sink_tokens are both scalars/constexprs) can sometimes cause Triton compilation issues or unexpected scalar promotion behavior depending on the Triton version. Using a standard Python conditional expression is safer and guaranteed to be evaluated at compile time.

Suggested change
recent_local_tokens = tl.maximum(range_end - sink_tokens, 0)
recent_local_tokens = (range_end - sink_tokens) if (range_end - sink_tokens) > 0 else 0

"use_31_block": true,
"dit_quantized": true,
"dit_quantized_ckpt": "/SekoTalk-Distill-AR/converted_fp8.safetensors",
"dit_quantized_ckpt": "/data/nvme5/gushiqiao/models/SekoTalk-Distill-AR-0703/seko_ar_new_rope_fp8_4steps.safetensors",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding absolute paths with specific user directories (e.g., /data/nvme5/gushiqiao/...) makes the configuration non-portable and prone to breaking across different environments or users. Consider using relative paths, environment variables, or placeholder values.

Suggested change
"dit_quantized_ckpt": "/data/nvme5/gushiqiao/models/SekoTalk-Distill-AR-0703/seko_ar_new_rope_fp8_4steps.safetensors",
"dit_quantized_ckpt": "models/SekoTalk-Distill-AR-0703/seko_ar_new_rope_fp8_4steps.safetensors",

Comment on lines +3 to +4
lightx2v_path=/data/nvme5/gushiqiao/codes/LightX2V
model_path=/data/nvme5/gushiqiao/models/SekoTalk-Distill-AR-0703/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding absolute paths with specific user directories (e.g., /data/nvme5/gushiqiao/...) makes the script non-portable. Consider using relative paths or environment variables to locate the repository and model directories.

Suggested change
lightx2v_path=/data/nvme5/gushiqiao/codes/LightX2V
model_path=/data/nvme5/gushiqiao/models/SekoTalk-Distill-AR-0703/
lightx2v_path=$(pwd)
model_path=models/SekoTalk-Distill-AR-0703/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants