Skip to content

feat(scheduler): Implement Agent Ledger, Accounting, and Jain's Fairness Index - #557

Open
mahaswetha17 wants to merge 1 commit into
agiresearch:mainfrom
navaneedan07:feature/agent-ledger
Open

mahaswetha17 wants to merge 1 commit into
agiresearch:mainfrom
navaneedan07:feature/agent-ledger

Conversation

@mahaswetha17

Copy link
Copy Markdown

Summary of Changes

This pull request implements the Agent Ledger, Accounting, and Fairness Metrics subsystem for our priority and fair-share scheduling pipeline[cite: 1].

  • Agent Record & State (aios/scheduler/ledger.py): Tracks agent_id, priority, weight, arrival_time, wait_ticks, and service_count.
  • Waiting & Service Accounting:
    • update_waiting_ticks(): Automatically increments wait time for queued requests to support Navaneedan's priority aging mechanism[cite: 1].
    • record_service(): Logs scheduling service allocations to support Hitesh's stride/fair-share scheduling evaluation[cite: 1].
  • Quantitative Observability: Implemented Jain's Fairness Index ($J = (\sum x_i)^2 / (n \times \sum x_i^2)$) to quantitatively measure allocation fairness across workloads[cite: 1].
  • Unit Tests (tests/test_ledger.py): Added full test coverage verifying registration, accounting increments, and fairness calculations[cite: 1]. All tests passing locally.

Testing & Verification

  • Ran local pytest suite successfully: pytest tests/test_ledger.py -v (all tests passed cleanly).

Thank you for your contribution to AIOS!
Before submitting the pull request, please make sure to read and follow requirements below and then you can replace all the texts with your own messages. This helps improve the efficiency of the review process.

Remember to update documentation

When adding new features or updating existing functions, please review the documentation to determine if any changes are required. If so, ensure that the documentation is updated accordingly. The source code for the documentation is located at: https://github.com/agiresearch/AIOS/tree/main/docs. Instructions for writing documentation can be found here: https://github.com/agiresearch/AIOS/blob/main/docs/README.md.

Write informative PR title and classification

Only specific types of PRs will be reviewed. The PR title is prefixed appropriately (i.e., "prefix: description") to indicate the type of change. Please use one of the prefixs as below:

  • feat Add new features
  • fix Fix bugs
  • docs Modify documents like README, CONTRIBUTE
  • style Modify code format like space and comma without changing code logic
  • refactor Refactor code structure without adding new features or fixing new bugs
  • perf Improve performance or user experience
  • test Test features, including unit test and integration test
  • chore Change the build procedure or add dependencies
  • revert Revert to the previous version

Wait for the reviews

This branch has not been deployed

No deployments
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