Skip to content

E2e rag robustness fixes#2625

Open
mkankana wants to merge 15 commits into
mlcommons:masterfrom
mkankana:e2e-rag-robustness-fixes
Open

E2e rag robustness fixes#2625
mkankana wants to merge 15 commits into
mlcommons:masterfrom
mkankana:e2e-rag-robustness-fixes

Conversation

@mkankana

@mkankana mkankana commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
  1. Fixed a bug causing 0 retrievals due to json parsing error.
  2. Updated the folder name of model to match the mlc storage download patterns.

mkankana and others added 3 commits July 4, 2026 11:58
This commit improves the reliability of the multi-shot retrieval system:

1. **Robust JSON Parsing** (multi_shot_retrieval.py, accuracy_eval.py):
   - Use regex-based extraction to handle JSON in markdown code blocks
   - Extract JSON objects from mixed text/markdown LLM responses
   - Add fallback behavior when JSON parsing fails instead of crashing
   - Applied to: evaluate_document_relevance(), check_sufficiency(),
     generate_search_queries(), query_rewriter(), call_judge()

2. **URL Extraction Fixes** (multi_shot_retrieval.py):
   - Support both 'original_url' and 'source' metadata fields
   - Convert Wikipedia filenames (en.wikipedia.org_wiki_*.html) to URLs
   - Debug logging for URL extraction issues

3. **Metrics Compatibility** (multi_shot_retrieval.py):
   - Add backward-compatible aliases (precision, recall, f1)
   - SUT expects different key names than evaluation module produces
   - Added 'retrieved_urls' to metrics output

4. **Config Updates** (user.conf):
   - Added e2e-datasetup.Offline configuration

These changes make the system more resilient to LLM output variations
without changing the underlying retrieval logic or model assignments.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Download additional 470 URLs files.
@mkankana
mkankana requested review from a team as code owners July 9, 2026 20:51
@github-actions

github-actions Bot commented Jul 9, 2026

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.
1 out of 2 committers have signed the MLCommons CLA.
@mkankana
@rpoornac
You can retrigger this bot by commenting recheck in this Pull Request

mkankana and others added 12 commits July 13, 2026 22:07
Align naming end-to-end across the workload and submission tooling:
- checker constants.py: e2e -> e2e-rag-qna, e2e_vectorDB -> e2e-rag-db
- user.conf loadgen keys and FromConfig namespaces
- reference-script output dirs (nested accuracy/performance to avoid
  the run_output/output collision between QnA accuracy and perf runs)
- datasetup scripts: patch e2e-rag-db.Offline.* (was dead e2e-datasetup.*)
- compliance/TEST09/e2e-rag -> e2e-rag-qna (+ README, run_compliance paths)
- fix stale "E2E DocGrader" header comments

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The RAG-DB accuracy test only did local self-consistency checks and
never verified the built vector DB against the reference manifest, so a
divergent corpus/embedding could still pass.

- db_manifest.py: extract cmd_verify body into reusable verify_manifest()
  that returns {passed, failures, metrics} instead of sys.exit; add a
  --retriever_model override (manifest's stored path is a system-specific
  absolute path that breaks verify on other systems) with fallback to the
  manifest value.
- datasetup_accuracy_eval.py: run verify_manifest() when --manifest is
  given; record results in accuracy_results["manifest"], gate overall pass
  on it, and write a manifest section into accuracy.txt. Skipped cleanly
  when no manifest is provided.
- reference_mlperf_datasetup_accuracy.sh: pass the bundled reference
  manifest (scripts/db_manifest_intel_xpu.json.gz) by default.
- scripts/verify_db_manifest.sh: pass local retriever model to verify.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The RAG-QnA accuracy run produced only accuracy_results.json; the
submission checker needs an accuracy.txt with an "Accuracy:" line.

- accuracy_eval.py: write accuracy.txt into the loadgen log dir with the
  LLM judge answer accuracy as a percentage (answer_accuracy * 100),
  matching the checker's E2E_ACCURACY pattern. hash= line and truncation
  are added later by truncate_accuracy_log.py during submission prep.
- reference_mlperf_{accuracy,perf}.sh: fix stale user.conf sed patch that
  still targeted the old e2e.Offline key (now e2e-rag-qna.Offline).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The submission checker gates compliance validation on the models_TESTxx
lists; e2e-rag-qna was in none, so TEST09 results were silently unchecked
despite the workload shipping run_compliance_test09.sh and producing
verify_output_len.txt.

Add e2e-rag-qna to models_TEST09 (v6.1) so the checker requires
TEST09/verify_output_len.txt and validates it contains "TEST PASS".
e2e-rag-db has no compliance test and is left out.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Workload-side fixes validated end-to-end via a 10-doc/10-query smoke run
through OpenRouter in a container:

- run_compliance_test09.sh: pass --audit_conf to reference_mlperf.py so
  loadgen actually applies the TEST09 audit.config (previously the default
  audit.conf was used, leaving accuracy_log_sampling_target=0 and an empty
  mlperf_log_accuracy.json -> verification found no entries). Make PERF_COUNT
  overridable and sync the audit.config min_query_count to it. Source the
  TEST09 config from the main repo's compliance tree (copied in / overridable
  via COMPLIANCE_DIR).
- reference_mlperf_{perf,accuracy}.sh: capture and propagate the python exit
  code (was masked by a trailing echo, so failures looked like success).
- datasetup_accuracy_eval.py: write a checker-compliant "Accuracy:" line
  (indexing success rate) and always emit the DB Manifest Verification
  section (PASS/FAIL/SKIPPED) in accuracy.txt.
- reference_mlperf_datasetup_accuracy.sh: honor an explicit empty/"none"
  MANIFEST to skip the manifest check (use ${VAR-default} so empty is
  respected).
- user.conf: e2e-rag-db counts 2503->2515; drop dead e2e-datasetup.* keys.
- .gitignore: ignore run_output_*/output/submission smoke artifacts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The e2e-rag rename originally also edited the submission checker's
constants.py, but all checker changes now live in the dedicated
e2e-rag-submission-checker-fixes branch/PR. Revert constants.py to
upstream here so the workload PR touches no checker files and does not
conflict with the checker PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…s-fixes

# Conflicts:
#	e2e-rag/evaluation.py
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.

3 participants