{"id":19156467,"url":"https://github.com/kyegomez/moe-mamba","last_synced_at":"2025-05-07T07:42:53.937Z","repository":{"id":218438708,"uuid":"746412048","full_name":"kyegomez/MoE-Mamba","owner":"kyegomez","description":"Implementation of MoE Mamba from the paper: \"MoE-Mamba: Efficient Selective State Space Models with Mixture of Experts\" in Pytorch and Zeta","archived":false,"fork":false,"pushed_at":"2025-04-06T12:53:33.000Z","size":2274,"stargazers_count":102,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-19T20:17:06.178Z","etag":null,"topics":["ai","ml","moe","multi-modal-fusion","multi-modality","swarms"],"latest_commit_sha":null,"homepage":"https://discord.gg/GYbXvDGevY","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyegomez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["kyegomez"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2024-01-21T23:30:45.000Z","updated_at":"2025-04-07T15:17:47.000Z","dependencies_parsed_at":"2024-11-09T08:36:09.429Z","dependency_job_id":"7abb7802-a9f3-4981-b3b8-0c67c89585b0","html_url":"https://github.com/kyegomez/MoE-Mamba","commit_stats":null,"previous_names":["kyegomez/moe-mamba"],"tags_count":0,"template":false,"template_full_name":"kyegomez/Python-Package-Template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMoE-Mamba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMoE-Mamba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMoE-Mamba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyegomez%2FMoE-Mamba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyegomez","download_url":"https://codeload.github.com/kyegomez/MoE-Mamba/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252837042,"owners_count":21811828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ml","moe","multi-modal-fusion","multi-modality","swarms"],"created_at":"2024-11-09T08:34:34.730Z","updated_at":"2025-05-07T07:42:53.910Z","avatar_url":"https://github.com/kyegomez.png","language":"Python","funding_links":["https://github.com/sponsors/kyegomez"],"categories":[],"sub_categories":[],"readme":"[![Multi-Modality](agorabanner.png)](https://discord.gg/qUtxnK2NMf)\n\n# MoE Mamba\nImplementation of MoE Mamba from the paper: \"MoE-Mamba: Efficient Selective State Space Models with Mixture of Experts\" in Pytorch and Zeta. The `SwitchMoE` architecture is from the Switch Transformer paper. And, I still need help with it. If you want to help please join the Agora discord and server and help in the MoE Mamba channel.\n\n[PAPER LINK](https://arxiv.org/abs/2401.04081)\n\n\n## Install\n\n```bash\npip install moe-mamba\n```\n\n## Usage\n\n### `MoEMambaBlock` \n```python\nimport torch \nfrom moe_mamba import MoEMambaBlock\n\nx = torch.randn(1, 10, 512)\nmodel = MoEMambaBlock(\n    dim=512,\n    depth=6,\n    d_state=128,\n    expand=4,\n    num_experts=4,\n)\nout = model(x)\nprint(out)\n\n```\n\n\n### `MoEMamba`\n\n```python\nimport torch \nfrom moe_mamba.model import MoEMamba \n\n\n# Create a tensor of shape (1, 1024, 512)\nx = torch.randint(0, 10000, (1, 512))\n\n# Create a MoEMamba model\nmodel = MoEMamba(\n    num_tokens=10000,\n    dim=512,\n    depth=1,\n    d_state=512,\n    causal=True,\n    shared_qk=True,\n    exact_window_size=True,\n    dim_head=64,\n    m_expand=4,\n    num_experts=4,\n)\n\n# Forward pass\nout = model(x)\n\n# Print the shape of the output tensor\nprint(out)\n\n```\n\n\n\n## Code Quality 🧹\n\n- `make style` to format the code\n- `make check_code_quality` to check code quality (PEP8 basically)\n- `black .`\n- `ruff . --fix`\n\n\n## Citation\n```bibtex\n@misc{pióro2024moemamba,\n    title={MoE-Mamba: Efficient Selective State Space Models with Mixture of Experts}, \n    author={Maciej Pióro and Kamil Ciebiera and Krystian Król and Jan Ludziejewski and Sebastian Jaszczur},\n    year={2024},\n    eprint={2401.04081},\n    archivePrefix={arXiv},\n    primaryClass={cs.LG}\n}\n\n```\n\n\n# License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fmoe-mamba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyegomez%2Fmoe-mamba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyegomez%2Fmoe-mamba/lists"}