Skip to content

fix(e2e-rag): drop the duplicated second half of QSL.py - #2673

Open
Anai-Guo wants to merge 1 commit into
mlcommons:masterfrom
Anai-Guo:fix-e2e-rag-qsl-duplicated-body
Open

fix(e2e-rag): drop the duplicated second half of QSL.py#2673
Anai-Guo wants to merge 1 commit into
mlcommons:masterfrom
Anai-Guo:fix-e2e-rag-qsl-duplicated-body

Conversation

@Anai-Guo

Copy link
Copy Markdown

Problem

e2e-rag/QSL.py is 295 lines, and lines 150-295 are a verbatim second copy of the
file's own body
— the Apache header, the module docstring, class E2EQSL and
class E2EQSLInMemory all appear twice. Only the three imports (os, pandas,
mlperf_loadgen) are not repeated:

  1  # Copyright 2025 The MLPerf Authors. All Rights Reserved.
 16  """Query Sample Library for RAG-QnA workload. ..."""
 21  import os / import pandas as pd / import mlperf_loadgen as lg
 26  class E2EQSL:
136  class E2EQSLInMemory(E2EQSL):
---
150  # Copyright 2025 The MLPerf Authors. All Rights Reserved.   <- second copy starts
166  """Query Sample Library for RAG-QnA workload. ..."""
172  class E2EQSL:
282  class E2EQSLInMemory(E2EQSL):

Python executes both class statements, so the module-level names are rebound to the
second copy and the first 124 lines of class definitions are dead code. The
duplication has been present since the file was added in #2602.

Verification

Source lines 26-148 and 172-294 compare byte-identical, and each class pair has an
identical AST:

E2EQSL:          L26-133  vs L172-279   AST-identical=True
E2EQSLInMemory:  L136-149 vs L282-295   AST-identical=True
byte-identical source blocks: True  (124 lines each)

Fix

Remove the second copy — 146 lines deleted, 0 added, one file. After the change the
module still defines exactly E2EQSL and E2EQSLInMemory with the same bodies and the
same imports, so behaviour is unchanged:

classes after patch: ['E2EQSL', 'E2EQSLInMemory']
295 -> 149 lines

AI-assisted (found by a duplicate-class-definition sweep; the byte/AST comparison
above is the check I ran before submitting).

🤖 Generated with Claude Code

e2e-rag/QSL.py is 295 lines, and lines 150-295 are a verbatim second copy of
the file's own body: the Apache header, the module docstring, `class E2EQSL`
and `class E2EQSLInMemory` all appear twice. Only the three imports (`os`,
`pandas`, `mlperf_loadgen`) are not repeated.

Source lines 26-148 and 172-294 are byte-identical, and the two `E2EQSL` /
`E2EQSLInMemory` pairs have identical ASTs, so Python simply rebinds both names
to the second copy and the first 124 lines of class definitions are dead. The
duplication has been there since the file was added in mlcommons#2602.

This removes the second copy (146 lines, no additions). The module keeps the
same two classes with the same bodies, so behaviour is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Anai-Guo
Anai-Guo requested review from a team as code owners September 11, 2026 22:27
@github-actions

Copy link
Copy Markdown
Contributor

MLCommons CLA bot:
Thank you very much for your submission; we really appreciate it. Before we can accept your contribution,
we ask that you sign the MLCommons CLA (Apache 2). Please submit your GitHub ID to our onboarding form to initiate
authorization. If you are from a MLCommons member organization, we will request that you be added to the CLA.
If you are not from a member organization, we will email you a CLA to sign. For any questions, please contact
support@mlcommons.org.
0 out of 1 committers have signed the MLCommons CLA.
@Anai-Guo
You can retrigger this bot by commenting recheck in this Pull Request

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.

1 participant