Skip to content

Conversation

@Jiang-Jia-Jun
Copy link
Collaborator

@Jiang-Jia-Jun Jiang-Jia-Jun commented Nov 20, 2025

Remove detailed string representation for Request class.

Motivation

解决RL中无法理解的问题,由于此函数仅用于DEBUG,暂时移除

Modifications

Usage or Command

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

Remove detailed string representation for Request class.
Copilot AI review requested due to automatic review settings November 20, 2025 13:17
@paddle-bot
Copy link

paddle-bot bot commented Nov 20, 2025

Thanks for your contribution!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the __repr__ method of the Request class by removing detailed string representation logic and replacing it with an empty string return. The change is motivated by resolving an unspecified issue in the RL (Reinforcement Learning) component where the current implementation cannot be understood, and since the function is only for debugging, it's being temporarily removed.

Key changes:

  • Removed conditional debug-based string formatting from Request.__repr__
  • Removed error handling wrapper in __repr__
  • Simplified return value to empty string

return f"Request({', '.join(non_none_fields)})"
except Exception as e:
return f"<{self.__class__.__name__} repr failed: {e}>"
return ""
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Returning an empty string from __repr__ violates Python conventions and breaks debugging expectations. The __repr__ method should return a useful string representation of the object. If the detailed representation is causing issues, consider returning a minimal but informative representation like f"<Request {self.request_id}>" or at minimum f"Request(request_id={self.request_id!r})" to maintain basic debugging capability. Returning an empty string will make logging, debugging, and error messages confusing when Request objects are printed.

Copilot uses AI. Check for mistakes.
@Jiang-Jia-Jun Jiang-Jia-Jun changed the base branch from develop to feature/experimental_feature_20250908 November 20, 2025 13:29
@Jiang-Jia-Jun Jiang-Jia-Jun changed the base branch from feature/experimental_feature_20250908 to develop November 20, 2025 13:29
@Jiang-Jia-Jun Jiang-Jia-Jun merged commit d2298dc into develop Nov 21, 2025
20 of 22 checks passed
@Jiang-Jia-Jun Jiang-Jia-Jun deleted the Jiang-Jia-Jun-patch-1 branch November 21, 2025 09:28
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