Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata agnostic user computation hash #8557

Merged

Conversation

rpsilva-aws
Copy link
Contributor

@rpsilva-aws rpsilva-aws commented Jan 11, 2025

Cherry pick of #8550

This fixes #8538.

Test context:

  • input_scope_0
HloModule IrToHlo.16, entry_computation_layout={(s64[])->(f32[])}

%computation.6 (p0.7: f32[], p1.8: f32[]) -> (f32[]) {
  %p0.7 = f32[] parameter(0)
  %p1.8 = f32[] parameter(1)
  %maximum.9 = f32[] maximum(f32[] %p0.7, f32[] %p1.8)
  %minimum.10 = f32[] minimum(f32[] %p0.7, f32[] %p1.8)
  %subtract.11 = f32[] subtract(f32[] %maximum.9, f32[] %minimum.10)
  ROOT %tuple.12 = (f32[]) tuple(f32[] %subtract.11)
}

ENTRY %IrToHlo.16 (p0.1: s64[]) -> (f32[]) {
  %p0.1 = s64[] parameter(0), metadata={op_type="xla__device_data" op_name="xla__device_data" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=43}
  %convert.4 = f32[] convert(s64[] %p0.1), metadata={op_type="aten__sin" op_name="aten__sin" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=32}
  %sine.5 = f32[] sine(f32[] %convert.4), metadata={op_type="aten__sin" op_name="aten__sin" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=32}
  %convert.2 = f32[] convert(s64[] %p0.1), metadata={op_type="aten__cos" op_name="aten__cos" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=33}
  %cosine.3 = f32[] cosine(f32[] %convert.2), metadata={op_type="aten__cos" op_name="aten__cos" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=33}
  %call.13 = (f32[]) call(f32[] %sine.5, f32[] %cosine.3), to_apply=%computation.6, metadata={op_type="xla__computation" op_name="xla__computation" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=50}
  %get-tuple-element.14 = f32[] get-tuple-element((f32[]) %call.13), index=0, metadata={op_type="xla__computation" op_name="xla__computation" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=50}
  ROOT %tuple.15 = (f32[]) tuple(f32[] %get-tuple-element.14)
}
  • input_scope_1
HloModule IrToHlo.16, entry_computation_layout={(s64[])->(f32[])}

%computation.6 (p0.7: f32[], p1.8: f32[]) -> (f32[]) {
  %p0.7 = f32[] parameter(0)
  %p1.8 = f32[] parameter(1)
  %maximum.9 = f32[] maximum(f32[] %p0.7, f32[] %p1.8)
  %minimum.10 = f32[] minimum(f32[] %p0.7, f32[] %p1.8)
  %subtract.11 = f32[] subtract(f32[] %maximum.9, f32[] %minimum.10)
  ROOT %tuple.12 = (f32[]) tuple(f32[] %subtract.11)
}

ENTRY %IrToHlo.16 (p0.1: s64[]) -> (f32[]) {
  %p0.1 = s64[] parameter(0), metadata={op_type="xla__device_data" op_name="xla__device_data" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=38}
  %convert.4 = f32[] convert(s64[] %p0.1), metadata={op_type="aten__sin" op_name="aten__sin" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=38}
  %sine.5 = f32[] sine(f32[] %convert.4), metadata={op_type="aten__sin" op_name="aten__sin" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=38}
  %convert.2 = f32[] convert(s64[] %p0.1), metadata={op_type="aten__cos" op_name="aten__cos" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=39}
  %cosine.3 = f32[] cosine(f32[] %convert.2), metadata={op_type="aten__cos" op_name="aten__cos" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=39}
  %call.13 = (f32[]) call(f32[] %sine.5, f32[] %cosine.3), to_apply=%computation.6, metadata={op_type="xla__computation" op_name="xla__computation" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=50}
  %get-tuple-element.14 = f32[] get-tuple-element((f32[]) %call.13), index=0, metadata={op_type="xla__computation" op_name="xla__computation" source_file="/ansible/pytorch/xla/test_user_computation_debug_cache.py" source_line=50}
  ROOT %tuple.15 = (f32[]) tuple(f32[] %get-tuple-element.14)
}

@rpsilva-aws rpsilva-aws marked this pull request as ready for review January 11, 2025 02:27
@tengyifei tengyifei merged commit 8f5d7bd into pytorch:r2.6 Jan 11, 2025
12 checks passed
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