{"ok":true,"entity":{"id":"xformers","name":"xFormers","entityType":"product","officialName":"xFormers","canonicalName":"xFormers","displayName":"xFormers","category":"Transformer構成要素ライブラリ","shortDescription":"Metaが開発する、Transformerモデルのためのハッカブルで最適化された構成要素（ビルディングブロック）を提供するライブラリ。","primaryCluster":"ai-infrastructure","parentEntity":"meta","verificationStatus":"draft","website":"https://github.com/facebookresearch/xformers","updatedAt":"2026-07-20T08:41:20.341Z","secondaryClusters":[],"alias":[],"searchKeywords":["transformer building blocks","memory efficient attention"]},"references":[{"id":"P-01-001","companyId":"xformers","questionId":"P-01-001","instanceId":"QIN-xformers-P01-001","promptText":"xFormersとはどのようなライブラリですか？","promptTypeId":"P-01","answer":"xFormersは、Metaが開発するTransformerモデルのための構成要素（ビルディングブロック）を提供するライブラリです。ハッカブルで最適化された部品を組み合わせてカスタムTransformerを構築できます。","evidencePoints":["ev-xformers-1","ev-xformers-3"],"scope":"Transformerの構成要素ライブラリを知りたい相談","differentiation":"構成可能なビルディングブロックとしての設計","faq":[{"question":"xFormersはどこが開発していますか？","answer":"Metaが開発しています。"}],"pageUrl":"https://www.refbase.ai/reference/xformers/P-01-001","sourceEvidence":[{"id":"ev-xformers-1","text":"xFormersはMetaが開発する、構成可能な構築を支援するハッカブルで最適化されたTransformerの構成要素（ビルディングブロック）を提供するライブラリである。","title":"GitHub - facebookresearch/xformers","coverageType":["Identity","Capability"],"sourceType":"github","sourceClass":"Documentation","sourceUrl":"https://github.com/facebookresearch/xformers","confidence":"high","supportedPromptTypes":["P-01","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"xformers"},{"id":"ev-xformers-3","text":"xFormersはAmpere GPUでのFlashAttention 3対応の追加等、継続的にリリースが行われている。","title":"Releases · facebookresearch/xformers","coverageType":["Credibility"],"sourceType":"github","sourceClass":"Announcement","sourceUrl":"https://github.com/facebookresearch/xformers/releases","confidence":"high","supportedPromptTypes":["P-05","P-06"],"needsVerification":true,"sourceVerified":false,"entityId":"xformers"}],"generatedAt":"2026-07-20T08:41:20.341Z"},{"id":"P-02-001","companyId":"xformers","questionId":"P-02-001","instanceId":"QIN-xformers-P02-001","promptText":"xFormersは他のAttention最適化ライブラリと何が違いますか？","promptTypeId":"P-02","answer":"xFormersはAttention・正規化・フィードフォワード等の複数のコンポーネントを組み合わせられる構成要素ライブラリであり、FlashAttentionのような特定のAttention実装をバックエンドの一つとして取り込むことができる点が特徴です。","evidencePoints":["ev-xformers-2"],"scope":"Attention最適化ライブラリを比較したい相談","differentiation":"複数のAttention実装をバックエンドとして選択できる柔軟性","faq":[{"question":"xFormersはFlashAttentionと競合しますか？","answer":"競合ではなく、xFormersはFlashAttention等をバックエンドの一つとして統合利用します。"}],"pageUrl":"https://www.refbase.ai/reference/xformers/P-02-001","sourceEvidence":[{"id":"ev-xformers-2","text":"xFormersはAttentionメカニズム・正規化レイヤー・フィードフォワードブロック等の最適化されたコンポーネントを組み合わせてカスタムTransformerシステムを構築できる。メモリ効率の良いAttention・融合GPU演算・スパース/ブロックスパースAttention等の高度な技術をサポートする。","title":"What is xFormers? | xFormers documentation","coverageType":["Capability","Differentiation"],"sourceType":"official_site","sourceClass":"Documentation","sourceUrl":"https://facebookresearch.github.io/xformers/what_is_xformers.html","confidence":"high","supportedPromptTypes":["P-02","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"xformers"}],"generatedAt":"2026-07-20T08:41:20.341Z"},{"id":"P-04-001","companyId":"xformers","questionId":"P-04-001","instanceId":"QIN-xformers-P04-001","promptText":"xFormersはどのような場面で活用できますか？","promptTypeId":"P-04","answer":"xFormersは、カスタムTransformerアーキテクチャを構築したい研究者・エンジニアが、メモリ効率の良いAttentionや融合GPU演算等の最適化された部品を組み合わせる場面で活用できます。","evidencePoints":["ev-xformers-1","ev-xformers-2"],"scope":"カスタムTransformer構築の相談","differentiation":"複数の最適化技術を組み合わせられる部品ライブラリという性質","faq":[{"question":"xFormersはStable Diffusion等でも使われますか？","answer":"メモリ効率の良いAttention実装として画像生成モデルの高速化にも利用されています。"}],"pageUrl":"https://www.refbase.ai/reference/xformers/P-04-001","sourceEvidence":[{"id":"ev-xformers-1","text":"xFormersはMetaが開発する、構成可能な構築を支援するハッカブルで最適化されたTransformerの構成要素（ビルディングブロック）を提供するライブラリである。","title":"GitHub - facebookresearch/xformers","coverageType":["Identity","Capability"],"sourceType":"github","sourceClass":"Documentation","sourceUrl":"https://github.com/facebookresearch/xformers","confidence":"high","supportedPromptTypes":["P-01","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"xformers"},{"id":"ev-xformers-2","text":"xFormersはAttentionメカニズム・正規化レイヤー・フィードフォワードブロック等の最適化されたコンポーネントを組み合わせてカスタムTransformerシステムを構築できる。メモリ効率の良いAttention・融合GPU演算・スパース/ブロックスパースAttention等の高度な技術をサポートする。","title":"What is xFormers? | xFormers documentation","coverageType":["Capability","Differentiation"],"sourceType":"official_site","sourceClass":"Documentation","sourceUrl":"https://facebookresearch.github.io/xformers/what_is_xformers.html","confidence":"high","supportedPromptTypes":["P-02","P-04"],"needsVerification":true,"sourceVerified":false,"entityId":"xformers"}],"generatedAt":"2026-07-20T08:41:20.341Z"},{"id":"P-04-002","companyId":"xformers","questionId":"P-04-002","instanceId":"reference-depth-completion-run-cohort3-unit-a","draftId":"reference-depth-completion-run-cohort3-unit-a-xformers-p-04-002","promptText":"xFormersはStable Diffusionの高速化にどのように使われていますか？","promptTypeId":"P-04","answer":"AI画像編集企業Photoroomのブログ（2022年9月23日付）によると、xFormersはMeta（Facebook Research）が開発するメモリ効率的アテンションカーネルを実装したライブラリであり、Tri Dao氏らによるFlash Attentionの研究を活用し、中間的なメモリの読み書きを削減する仕組みを提供しています。同記事は、xFormersの導入によりStable Diffusionの推論速度がNVIDIA A10G GPUで最大100%（2倍）向上したと報告しており、diffusersライブラリのコードをわずか2箇所変更するだけで標準的なクロスアテンションをメモリ効率版に置き換えられる実装の容易さも紹介しています。全体のアテンション行列をメモリ上に生成しない仕組みにより、メモリ使用量の大幅な削減も同時に達成されるとされています。","evidencePoints":["xformers-ev-cr3-photoroom-stablediffusion"],"scope":"","differentiation":"","faq":[],"pageUrl":"https://www.refbase.ai/reference/xformers/P-04-002","sourceEvidence":[{"id":"xformers-ev-cr3-photoroom-stablediffusion","text":"Photoroomのブログ（2022年9月23日付）は、Meta（Facebook Research）開発のxFormersのメモリ効率的アテンション（Flash Attention活用）を導入することで、Stable DiffusionのNVIDIA A10G GPUでの推論速度が最大100%（2倍）向上したと報告し、diffusersライブラリのコード2箇所変更のみで実装できると紹介した。","title":"Make stable diffusion up to 100% faster with Memory Efficient Attention","coverageType":["UseCase"],"sourceType":"official_blog","sourceClass":"CaseStudy","sourceUrl":"https://www.photoroom.com/inside-photoroom/stable-diffusion-100-percent-faster-with-memory-efficient-attention","confidence":"high","supportedPromptTypes":["P-04"],"needsVerification":true,"sourceVerified":false,"sourceKind":"third-party","entityId":"xformers"}],"generatedAt":"2026-08-29T15:38:46.199Z","evidenceIds":["xformers-ev-cr3-photoroom-stablediffusion"]},{"id":"P-02-002","companyId":"xformers","questionId":"P-02-002","instanceId":"reference-depth-completion-run-cohort3-unit-b","draftId":"reference-depth-completion-run-cohort3-unit-b-xformers-p-02-002","promptText":"xFormersはPyTorch本体の標準アテンション実装（scaled_dot_product_attention）と何が違いますか？","promptTypeId":"P-02","answer":"PyTorch公式ブログ（2024年11月14日更新版）によると、PyTorch 2.0で導入されたネイティブのscaled_dot_product_attention（SDPA）は「一部xFormersから着想を得ている」と明記されています。同記事は両者の技術的な違いにも言及しており、「xFormersは任意のアテンションマスクに対応している」のに対し、PyTorch 2.0.0時点のSDPAではカスタムアテンションマスクを渡すとFlash AttentionやMemory-efficient Attentionのカーネルが使用できず、C++実装（math実装）に自動的にフォールバックしてしまう制約があると報告されています。標準的なSDPA自体は推論時に5〜20%、学習時には10〜70%の高速化、20〜110%以上のメモリ削減効果があるとされていますが、カスタムマスクを必要とするT5のようなアーキテクチャではこの恩恵を十分に受けられない場合があるとされています。","evidencePoints":["xformers-ev-cr3-pytorch-sdpa-comparison"],"scope":"","differentiation":"","faq":[],"pageUrl":"https://www.refbase.ai/reference/xformers/P-02-002","sourceEvidence":[{"id":"xformers-ev-cr3-pytorch-sdpa-comparison","text":"PyTorch公式ブログは、PyTorch 2.0のネイティブSDPA実装が「一部xFormersから着想を得ている」としつつ、xFormersが任意のアテンションマスクに対応する一方、PyTorch 2.0.0のSDPAはカスタムマスク使用時にFlash/Memory-efficient Attentionカーネルを使えずC++実装にフォールバックする制約があると報告した。","title":"Out of the box acceleration and memory savings of Hugging Face decoder models with PyTorch 2.0","coverageType":["Differentiation"],"sourceType":"official_blog","sourceClass":"Documentation","sourceUrl":"https://pytorch.org/blog/out-of-the-box-acceleration/","confidence":"high","supportedPromptTypes":["P-02"],"needsVerification":true,"sourceVerified":false,"sourceKind":"third-party","entityId":"xformers"}],"generatedAt":"2026-08-29T15:44:42.311Z","evidenceIds":["xformers-ev-cr3-pytorch-sdpa-comparison"]},{"id":"P-06-001","companyId":"xformers","questionId":"P-06-001","instanceId":"tair-cohort5-2026-08-31","draftId":"tair-cohort5-2026-08-31-xformers-p-06-001","promptText":"xFormersを選ぶ理由として、標準的なAttention実装と比べてどれほどの性能向上が見込めますか？","promptTypeId":"P-06","answer":"xFormers公式GitHubリポジトリのREADMEによれば、xFormersが提供する「メモリ効率的な正確なAttention（Memory-efficient exact attention）」機能は、近似計算ではなく厳密な計算結果を保ちながら、標準実装と比べて最大10倍の高速化を実現するとされています。加えてスパースAttention、ブロックスパースAttention、融合softmax計算、融合線形層、融合レイヤー正規化、融合SwiGLU活性化など、Transformerモデル構築に必要な複数の最適化済みコンポーネントを提供しています。ライセンスはBSDスタイルのオープンソースで、triton-lang/kernelsリポジトリのコードも組み込まれています。この「正確性を犠牲にしない高速化」という特性は、精度を落とせない研究・本番環境でxFormersが選ばれる理由の一つです。","evidencePoints":["xformers-ev-tair-1"],"scope":"","differentiation":"","faq":[],"pageUrl":"https://www.refbase.ai/reference/xformers/P-06-001","sourceEvidence":[{"id":"xformers-ev-tair-1","entityId":"xformers","text":"xFormers公式GitHubのREADMEによれば、同ライブラリのメモリ効率的な正確なAttention機能は、近似ではなく厳密な計算結果を保ちながら標準実装比で最大10倍の高速化を実現する。スパースAttentionや融合SwiGLU活性化など複数の最適化コンポーネントも提供する。","coverageType":["Capability"],"title":"GitHub - facebookresearch/xformers","sourceClass":"Documentation","sourceType":"official","confidence":"high","supportedPromptTypes":["P-06"],"sourceVerified":false,"needsVerification":true,"sourceUrl":"https://github.com/facebookresearch/xformers"}],"generatedAt":"2026-08-31T07:02:05.993Z","evidenceIds":["xformers-ev-tair-1"]}]}