diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index e8d213c7b2..0000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,132 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -* The use of sexualized language or imagery, and sexual attention or advances of - any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, - without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[opensource-conduct@group.apple.com](mailto:opensource-conduct@group.apple.com). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eaccfec88f..d3a4f444cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,39 +1,97 @@ -# Contributing to MLX +# Welcome to the MLX community! -We want to make contributing to this project as easy and transparent as -possible. +We welcome contributors of all backgrounds and experience levels. A community with diverse perspectives builds software with lasting impact. -## AI Usage Policy +[🤝 How you can help](#how-you-can-help) · [⚙️ Setting up your environment](#setting-up-your-environment) · [📝 Submitting issues and pull requests](#submitting-issues-and-pull-requests) · [🔀 Pull requests](#pull-requests) · [❤️ Code of conduct](#code-of-conduct) -AI-generated code is allowed. What is not allowed is submitting code you do not -understand. You are 100% responsible for every line, however it was produced, -and must explicitly disclose the manner in which AI was employed. +## How you can help -It is strictly prohibited to use AI to write your posts for you (bug reports, -feature requests, pull request descriptions, Github discussions, responding to -humans, ...). +- Report bugs with clear, reproducible steps +- Improve documentation to make the project more accessible +- Triage issues by providing feedback, testing, and validation +- Propose and implement enhancements of all sizes +- Share your experience by speaking about MLX at conferences or meetups -## Pull Requests +## Setting up your environment -- Make sure new code is covered by tests. Add new tests if not, and confirm - the new tests fail in the main branch. -- If performance may be impacted, run benchmarks for both the main branch and - the pull request. +See [Build and Install](https://ml-explore.github.io/mlx/build/html/install.html) for setup instructions. + +## Submitting issues and pull requests + +We maintain high standards to ensure quality across the project. + +Your contributions are evaluated on: + +- Technical quality and correctness +- Adherence to existing conventions and architectural patterns +- Demonstrated understanding of the implementation and its implications +- Clarity of communication +- Maintainability + +You may use productivity tools, including AI-assisted coding, to help you work more efficiently. +However, you remain fully accountable for all submitted code, issues, pull requests, and comments. +AI-generated content must meet the same standards as human-written contributions. Review, validate, and, as needed, +refine or rearrange AI-assisted work so the final contribution reflects your human creativity, understanding, and +control. Use your voice and expression when producing written materials. Misuse of AI tools in your contributions +and conversations may be considered a violation of our [Code of Conduct](#code-of-conduct). + +### Issues + +Before submitting an issue: + +- Search [existing issues](../../issues) to avoid duplicates. +- Write a clear, concise title and a detailed description. Ensure all information is accurate and fully understood by you. +- Include precise steps to reproduce the issue, expected behavior, and actual behavior. Verify these steps yourself. +- Specify your environment, MLX version, and any relevant configurations. +- Explain the severity and impact of the problem. +- For security issues, please see the [MLX security advisories](https://github.com/ml-explore/mlx?tab=security-ov-file). Do **not** open a public GitHub issue. + +#### Proposing features + +We welcome feature requests. Describe the proposed changes needed and why they matter. Please do not start with a pull request. Use the issue template that best matches your needs. + +### Pull requests + +⚠️ **Important:** We recommend an issue for larger changes to the codebase. + +Pull requests represent proposed solutions or enhancements. When submitting a pull request, verify it meets these expectations: + +- They should match an open issue but may not always. +- Address the stated problem or feature request completely and effectively. You must fully understand and validate your proposed solution. +- Solutions must be thorough, handle edge cases, and integrate cleanly. +- Include comprehensive tests that validate your changes and prevent regressions. +- If performance may be impacted, run benchmarks for both the main branch and the pull request. - When providing benchmarking results, include scripts and reproduction steps. -- Format the code with `uvx pre-commit run --all` before submitting a pull - request. You can also install git hooks to run it automatically: + +#### Pull request style guide and format + +Follow our coding style and formatting to maintain a consistent, readable codebase. + +- Write comprehensive and clear documentation. Concisely explain the 'why' behind complex decisions. +- Write clear, concise, and descriptive commit messages. +- Format the code with `pre-commit run --all` before submitting a pull request. You can also install git hooks to run it automatically: ```shell pip install pre-commit pre-commit install ``` -## Issues +#### Testing + +All contributions require thorough testing. + +**Local Testing:** Ensure all existing tests pass before submitting: + +```bash +python3 python/tests/run.py +``` + +**Automated Tests:** New features and bug fixes require corresponding automated tests that validate the intended behavior and prevent regressions. + +#### Running CI -We use GitHub issues to track public bugs. Please ensure your description is -clear and has sufficient instructions to be able to reproduce the issue. +CI runs automatically on every pull request and needs to be approved by a maintainer before it will run. -## License +## Code of conduct -By contributing to MLX, you agree that your contributions will be licensed -under the LICENSE file in the root directory of this source tree. +We are committed to fostering a community where different experiences and perspectives come together to create and collaborate. Good collaboration depends on honest feedback and respect for the time and effort every contributor brings to this project. [Please review our Code of Conduct](https://github.com/ml-explore/.github/blob/main/CODE_OF_CONDUCT.md); all community members are expected to adhere to it.