File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343# Filters and normalizes an HLO line to ignore environment-specific details.
4444STACK_FRAME_REGEX = re .compile (r"stack_frame_id=\d+" )
4545
46+ # The serialized Mosaic kernel of a Pallas custom call embeds the absolute path of the installed
47+ # jax package, so it differs between a venv install and a Docker image install even though the
48+ # compiled graph is the same. The kernel's shapes and block sizes are still checked, since they
49+ # appear as plain text elsewhere in the dump.
50+ CUSTOM_CALL_BODY_REGEX = re .compile (r'("custom_call_config":\{"body":")[^"]*(")' )
51+
4652
4753def filter_line (line ):
4854 # Matches operation sections content like: 1234 {"sharding parameters", ...} or 1234 "operation metadata"
4955 if SECTION_CONTENT_REGEX .match (line ):
5056 return None
5157 # Replace stack_frame_id=... with stack_frame_id=0
5258 line = STACK_FRAME_REGEX .sub ("stack_frame_id=0" , line )
59+ # Replace the serialized Mosaic kernel with a placeholder
60+ line = CUSTOM_CALL_BODY_REGEX .sub (r"\1<mosaic_body>\2" , line )
5361 return line
5462
5563
You can’t perform that action at this time.
0 commit comments