Skip to content

RAID1 Machine Learning Policies#227

Draft
ioeddk wants to merge 11 commits into
mainfrom
yingqi/raid1_merge/ml_policies
Draft

RAID1 Machine Learning Policies#227
ioeddk wants to merge 11 commits into
mainfrom
yingqi/raid1_merge/ml_policies

Conversation

@ioeddk
Copy link
Copy Markdown
Contributor

@ioeddk ioeddk commented May 16, 2026

Machine learning-based policies for RAID1, including:

  • Selection Policies: Neural Network (LinnOS), Smaller Neural Network (LinnOS+), Decision Tree (LinnOS+-DecisionTree).
  • Admission Policies: Heimdall.

As the second half of the PR #170

Copy link
Copy Markdown
Contributor

@arthurp arthurp left a comment

Choose a reason for hiding this comment

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

I know you didn't ask for a review yet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In general, Python files should go in the root of the crate or in some other sub directory (I used python/ in the data capture, but I'm open to changing it). src is the rust module tree specifically. The main reason I would put other files there is if the Rust build read them (like with some include! macro). Template files (*.j2 in this case) are a little complex I think, but I'm tempted to put them in the src tree if they are only used to generate one file, and out of tree if they are used more than once (since they will no longer have a unique position in the module tree).

Copy link
Copy Markdown
Contributor Author

@ioeddk ioeddk May 20, 2026

Choose a reason for hiding this comment

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

Before making this PR ready, I'm about to migrate those ML deployments to use Burn instead (as suggested by Aneesh), rather than those hacks that use Jinja2 and array initializations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Except that huge hard-coded decision tree. I vibe coded a Python script to dump the trained decision tree thresholds into giant hard-coded nested if-statements. I don't know a good alternative to make it cleaner yet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The Burn approach is good. I'd like an update on that soon though. I don't know what integrating it actually implies and I'd like to know so we can head off surprises.

I suspect the best approach for decision trees involves some Rust macros defining a DSL for decision tree. That makes the textual intermediate generate by the Python simpler and pushes more of the code generation into the actual rust compilation step. But it depends on how this will be used and the overall context. So let's talk at some point. This PR doesn't need to go this far though.

As for "vibe coded" stuff, if you want to merge it, I need you to understand how it work and be able to explain every line of code to me. Maybe "vibe code" doesn't mean this to you, but when people say that I assume it means they never read, clean, or understand the code. That's fine, I do it occasionally, but we can't merge that into main.

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