diff --git "a/nvidia_ja_jp_en_us_dev_blog_dataset.jsonl" "b/nvidia_ja_jp_en_us_dev_blog_dataset.jsonl" new file mode 100644--- /dev/null +++ "b/nvidia_ja_jp_en_us_dev_blog_dataset.jsonl" @@ -0,0 +1,19 @@ +{"en_url":"https:\/\/developer.nvidia.com\/blog\/three-building-blocks-for-creating-ai-virtual-assistants-for-customer-service-with-an-nvidia-nim-agent-blueprint\/","en_title":"Three Building Blocks for Creating AI Virtual Assistants for Customer Service with an NVIDIA AI Blueprint","en_content":"In today’s fast-paced business environment, providing exceptional customer service is no longer just a nice-to-have—it’s a necessity. Whether addressing technical issues, resolving billing questions, or providing service updates, customers expect quick, accurate, and personalized responses at their convenience. However, achieving this level of service comes with significant challenges.\nLegacy approaches, such as static scripts or manual processes, often fall short when it comes to delivering personalized and real-time support. Additionally, many customer service operations rely on sensitive and fragmented data, which is subject to strict data governance and privacy regulations. With the rise of generative AI, companies aim to revolutionize customer service by enhancing operational efficiency, cutting costs, and maximizing ROI.\nIntegrating AI into existing systems presents challenges related to transparency, accuracy, and security, which can impede adoption and disrupt workflows. To overcome these hurdles, companies are leveraging generative AI-powered virtual assistants to manage a wide range of tasks, ultimately improving response times and freeing up resources.\nThis post outlines how developers can use the\nNVIDIA AI Blueprint for AI virtual assistants\nto scale operations with generative AI. By leveraging this information, including sample code, businesses can meet the growing demands for exceptional customer service while ensuring data integrity and governance. Whether improving existing systems or creating new ones, this blueprint empowers teams to meet customer needs with efficient and meaningful interactions.\nSmarter AI virtual assistants with an AI query engine using retrieval-augmented generation\nWhen building an AI virtual assistant, it’s important to align with the unique use case requirements, institutional knowledge, and needs of the organization. Traditional bots, however, often rely on rigid frameworks and outdated methods that struggle to meet the evolving demands of today’s customer service landscape.\nAcross every industry, AI-based assistants can be transformational. For example, telecommunications companies, and the majority of retail and service providers, can use AI virtual assistants to enhance customer experience by offering support 24 hours a day, 7 days a week while handling a wide range of customer queries in multiple languages and providing dynamic, personalized interactions that streamline troubleshooting and account management. This helps reduce wait times and ensures consistent service across diverse customer needs.\nAnother example is within the healthcare insurance payor industry, where ensuring a positive member experience is critical. Virtual assistants enhance this experience by providing personalized support to members, addressing their claims, coverage inquiries, benefits, and payment issues, all while ensuring compliance with healthcare regulations. This also helps reduce the administrative burden on healthcare workers.\nWith the NVIDIA AI platform, organizations can create an AI query engine that uses\nretrieval-augmented generation (RAG)\nto connect AI applications to enterprise data. The AI virtual assistant blueprint enables developers to quickly get started building solutions that provide enhanced customer experiences. It is built using the following\nNVIDIA NIM\nmicroservices:\nNVIDIA NIM for LLM:\nBrings the power of state-of-the-art large language models (LLMs) to applications, providing unmatched natural language processing with remarkable efficiency.\nLlama 3.1 70B Instruct NIM\n:\nPowers complex conversations with superior contextual understanding, reasoning, and text generation.\nNVIDIA NeMo\nRetriever NIM:\nThis collection provides easy access to state-of-the-art models that serve as foundational building blocks for RAG pipelines. These pipelines, when integrated into virtual assistant solutions, enable seamless access to enterprise data, unlocking institutional knowledge via fast, accurate, and scalable answers.\nNeMo\nRetriever Embedding NIM\n:\nBoosts text question-answering retrieval performance, providing high-quality embeddings for the downstream virtual assistant.\nNeMo\nRetriever Reranking NIM\n:\nEnhances the retrieval performance further with a fine-tuned reranker, finding the most relevant passages to provide as context when querying an LLM.\nThe blueprint is designed to integrate seamlessly with existing customer service applications without breaking information security mandates. Thanks to the portability of NVIDIA NIM, organizations can integrate data wherever it resides. By bringing generative AI to the data, this architecture enables AI virtual assistants to provide more personalized experiences tailored to each customer by leveraging their unique profiles, user interaction histories, and other relevant data.\nA blueprint is a starting point that can be customized for an enterprise’s unique use case.  For example, integrate other NIM microservices, such as the\nNemotron 4 Hindi 4B Instruct\n, to enable an AI virtual assistant to communicate in the local language. Other microservices can enable additional capabilities such as synthetic data generation and model fine-tuning to better align with your specific use case requirements. Give the AI virtual assistant a humanlike interface when connected to the digital human AI Blueprint.\nWith the implementation of a RAG backend with proprietary data (both company and user profile and their specific data), the AI virtual assistant can engage in highly contextual conversations, addressing the specifics of each customer’s needs in real-time. Additionally, the solution operates securely within your existing governance frameworks, ensuring compliance with privacy and security protocols especially when working with sensitive data.\nThree building blocks for creating your own AI virtual assistant\nAs a developer, you can build your own AI virtual assistant that retrieves the most relevant and up-to-date information, in real time, with ever-improving humanlike responses. Figure 1 shows the AI virtual assistant architecture diagram which includes three functional components.\nFigure 1. The NVIDIA AI Blueprint for AI virtual assistants\n1. Data ingestion and retrieval pipeline\nPipeline administrators use the ingestion pipeline to load structured and unstructured data into the databases. Examples of structured data include customer profiles, order history, and order status. Unstructured data includes product manuals, the product catalog, and supporting material such as FAQ documents.\n2. AI agent\nThe AI virtual assistant is the second functional component. Users interact with the virtual assistant through a user interface. An AI agent, implemented in the LangGraph agentic LLM programming framework, plans how to handle complex customer queries and solves recursively. The LangGraph agent uses the tool calling feature of the\nLlama 3.1 70B Instruct NIM\nto retrieve information from both the unstructured and structured data sources, then generates an accurate response.\nThe AI agent also uses short-term and long-term memory functions to enable multi-turn conversation history. The active conversation queries and responses are embedded so they can be retrieved later in the conversation as additional context. This allows more human-like interactions and eliminates the need for customers to repeat information they’ve already shared with the agent.\nFinally, at the end of the conversation, the AI agent summarizes the discussion along with a sentiment determination and stores the conversation history in the structured database. Subsequent interactions from the same user can be retrieved as additional context in future conversations. Call summarization and conversation history retrieval can reduce call time and improve customer experience. Sentiment determination can provide valuable insights to the customer service administrator regarding the agent’s effectiveness.\n3. Operations pipeline\nThe customer operations pipeline is the third functional component of the overall solution. This pipeline provides important information and insight to the customer service operators. Administrators can use the operations pipeline to review chat history, user feedback, sentiment analysis data, and call summaries. The analytics microservice, which leverages the Llama 3.1 70B Instruct NIM, can be used to generate analytics such as average call time, time to resolution, and customer satisfaction. The analytics are also leveraged as user feedback to retrain the LLM models to improve accuracy.\nYou can find the complete example of how to get started with this Blueprint on the\nNVIDIA AI Blueprint GitHub repository.\nGet to production with NVIDIA partners\nNVIDIA consulting partners are helping enterprises adopt world-class AI virtual assistants built using NVIDIA accelerated computing and\nNVIDIA AI Enterprise software\n, which includes NeMo, NIM microservices, and AI Blueprints.\nAccenture\nThe Accenture AI Refinery\nbuilt on\nNVIDIA AI Foundry\nhelps design autonomous, intent-driven customer interactions, enabling businesses to tailor the journey to the individual through innovative channels such as digital humans or interaction agents. Specific use cases can be tailored to meet the needs of each industry, for example, telco call centers, insurance policy advisors, pharmaceutical interactive agents or automotive dealer network agents.\nDeloitte\nDeloitte Frontline AI enhances the customer service experience with digital avatars and LLM agents built with NVIDIA AI Blueprints that are accelerated by NVIDIA technologies such as NVIDIA ACE, NVIDIA Omniverse, NVIDIA Riva, and NIM.\nWipro\nWipro Enterprise Generative AI (WeGA) Studio accelerates industry-specific use cases including contact center agents across healthcare, financial services, retail, and more.\nTech Mahindra\nTech Mahindra is leveraging the NVIDIA AI Blueprint for digital humans to build solutions for customer service. Using RAG and NVIDIA NeMo, the solution provides the ability for a trainee to stop an agent during a conversation by raising a hand to ask clarifying questions. The system is designed to connect with microservices on the backend with a refined learning management system) which can be deployed across many industry use cases.\nInfosys\nInfosys Cortex\n, part of\nInfosys Topaz\n, is an AI-driven customer engagement platform that integrates NVIDIA AI Blueprints and the NVIDIA NeMo, Riva, and ACE technologies for generative AI, speech AI, and digital human capabilities to deliver specialized and individualized, proactive, and on-demand assistance to every member of a customer service organization, consequently playing a pivotal role in enhancing customer experience, improving operational efficiency, and reducing costs.\nTata Consultancy Services\nThe Tata Consultancy Services (TCS) virtual agent, powered by NVIDIA NIM, and integrated with ServiceNow’s IT Virtual Agent is designed to optimize IT and HR support. This solution uses prompt-tuning and RAG to improve response times, accuracy, and provide multi-turn conversational capabilities. Benefits include reduced service desk costs, fewer support tickets, enhanced knowledge utilization, faster deployment, and a better overall employee and customer experience.\nQuantiphi\nQuantiphi\nis integrating NVIDIA AI Blueprints into its conversational AI solutions to enhance customer service with lifelike digital avatars. These state-of-the-art avatars, powered by NVIDIA Tokkio and ACE technologies,\nNVIDIA NIM microservices\nand\nNVIDIA NeMo\n, seamlessly integrate with existing enterprise applications, enhancing operations and customer experiences with increased realism. Fine-tuned NIM deployments for digital avatar workflows have proven to be highly cost-effective, reducing enterprise spending on tokens.\nSoftServe\nSoftServe Digital Concierge\n, accelerated by NVIDIA AI Blueprints and NVIDIA NIM microservices, uses NVIDIA ACE, NVIDIA Riva, and the NVIDIA Audio2Face NIM microservice to deliver a highly realistic virtual assistant. Thanks to the Character Creator tool, it delivers speech and facial expressions with remarkable accuracy and lifelike detail.\nWith RAG capabilities from NVIDIA NeMo Retriever, SoftServe Digital Concierge can intelligently respond to customer queries by referencing context and delivering specific, up-to-date information. It simplifies complex queries into clear, concise answers and can also provide detailed explanations when needed.\nEXL\nEXL’s Smart Agent Assist offering is a contact center AI solution leveraging NVIDIA Riva, NVIDIA NeMo, and NVIDIA NIM microservices. EXL plans to augment their solution using the NVIDIA AI Blueprint for AI virtual agents.\nThis week at\nNVIDIA AI Summit India\n, NVIDIA consulting partners announced a collaboration with NVIDIA to transform India into a Front Office for AI. Using NVIDIA technologies, these consulting giants can help customers tailor the customer service agent blueprint to build unique virtual assistants using their preferred AI model—including sovereign LLMs from India-based model makers—and run it in production efficiently on the infrastructure of their choice.\nGet started\nTo try the blueprint for free, and to see system requirements, navigate to the\nBlueprint Card\n.\nTo start building applications using those microservices, visit the\nNVIDIA API catalog\n. To\nsign in\n, you’ll be prompted to enter a personal or business email address to access different options for building with NIM. For more information, see the\nNVIDIA NIM FAQ\n.\nThis post was originally published on 10\/23\/2024.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/three-building-blocks-for-creating-ai-virtual-assistants-for-customer-service-with-an-nvidia-nim-agent-blueprint\/","jp_title":"NVIDIA AI Blueprint でカスタマー サービス向けの AI バーチャル アシスタントを作成する 3 つの構成要素","jp_content":"Reading Time:\n2\nminutes\n今日のめまぐるしいビジネス環境では、優れたカスタマー サービスを提供することは、もはや単に「あれば良いこと」ではなく、「必要不可欠なこと」です。技術的な問題への対応、請求に関する質問の解決、サービスの最新情報の提供など、顧客は、迅速かつ正確で、顧客の都合にカスタマイズされた対応を期待しています。しかし、このレベルのサービスを実現するには、大きな課題が伴います。\nパーソナライズされたリアルタイムのサポートを提供するには、多くの場合、静的なスクリプトや手作業によるプロセスといった従来のアプローチでは不十分です。さらに、多くのカスタマー サービス業務では、機密性が高くかつ断片的なデータを取り扱うことになり、厳しいデータ管理��プライバシー規制の対象となります。生成 AI の台頭により、企業は運用効率の向上、コスト削減、ROI の最大化によってカスタマー サービスに革命を起こすことを目指しています。\nAI を既存のシステムに組み込む際には、透明性、精度、セキュリティに関する課題に直面し、導入を妨げ、ワークフローを中断させることもあるかもしれません。こうしたハードルを克服するために、企業は生成 AI を活用したバーチャル アシスタントを利用して幅広いタスクを管理し、最終的に応答時間を短縮して、リソースを解放しています。\nこの投稿では、開発者が、\nAI バーチャル アシスタントに NVIDIA AI Blueprint\nを使用して、生成 AI で業務を拡張する方法について説明します。サンプル コードを含むこの情報を活用することで、企業は、データの整合性とデータ ガバナンスを確保しながら、優れたカスタマー サービスへの高まる要求に応えることができます。既存のシステムの改善または新しいシステムの構築にかかわらず、この Blueprint によってチームは効率的で意味のあるやりとりを通じて顧客のニーズに対応することができます。\n検索拡張生成 (RAG) を使用した AI クエリ エンジンによるスマートな AI バーチャル アシスタント\nAI バーチャル アシスタントを構築する場合、独自のユース ケース要件および組織の知識やニーズに合わせて調整することが重要です。従来のボットでは、多くの場合、柔軟性の乏しいフレームワークと時代遅れのメソッドを利用しており、今日のカスタマー サービスのような常に変化し続ける要求に対応できません。\nあらゆる業界で、AI ベースのアシスタントが革新的な存在となり得ます。たとえば、通信会社や小売、サービス プロバイダーの大多数は、AI バーチャル アシスタントを使用して、24 時間 365 日稼働するサポートを提供しながら、多言語で幅広い顧客の問い合わせに対応し、トラブルシューティングやアカウント管理を合理化する、ダイナミックでパーソナライズされたやりとりを提供することで、顧客体験を向上させことができます。これにより、待ち時間を短縮し、さまざまな顧客ニーズに対して一貫したサービスを提供することができます。\nもうひとつの例として、医療保険の支払業界では、加入者にとって満足度の高い体験を確実に提供することが重要です。バーチャル アシスタントは、医療規制の遵守を確保しながら、加入者にパーソナライズされたサポートを提供し、請求、補償に関する問い合わせ、給付金、支払いに関する問題に対処することで、こうした体験を向上しています。これにより、医療従事者の管理上の負担を軽減することもできます。\nNVIDIA AI プラットフォームを使用することで、企業は、\n検索拡張生成 (RAG)\nを使用する AI クエリ エンジンを作成し、AI アプリケーションを企業データに接続することができます。AI バーチャル アシスタントの Blueprint により、開発者は、より洗練された顧客体験を提供するソリューションを迅速に構築し開始することができます。この Blueprint は、以下の\nNVIDIA NIM\nマイクロサービスを使用して構築されます。\nLLM 向け NVIDIA NIM:\n最先端の大規模言語モデル (LLM) のパワーをアプリケーションに取り入れ、大幅に効率化して、卓越した自然言語処理を提供します。\nLlama 3.1 70B Instruct NIM\n:\n優れた文脈理解、推論、テキスト生成で複雑な会話が可能です。\nNVIDIA NeMo\nRetriever NIM:\nRAG パイプラインの基礎となる構成要素である最先端モデルに簡単にアクセスできます。この RAG パイプラインによって、バーチャル アシスタントは企業データへのシームレスなアクセスが可能になり、迅速かつ正確でスケーラブルな回答で、組織の知識を活用できます。\nNeMo\nRetriever Embedding NIM\n:\nテキストの QA 検索タスクに特化されており、バーチャル アシスタントはこの高品質のテキスト埋め込みを利用します。\nNeMo\nRetriever Reranking NIM\n:\nファインチューニングされたリランキング モデルであり、埋め込みモデルと併用することで検索性能をさらに向上させることができます。入力文に最も関連性の高い文章を見付け出し、LLM に文脈として渡します。\nこの Blueprint は、情報セキュリティに関する義務に���することなく、既存のカスタマー サービス アプリケーションとシームレスに統合できるように設計されています。NVIDIA NIM の移植性のおかげで、企業は、データがどこにあっても統合することができます。生成 AI をデータに取り入れることで、AI バーチャル アシスタントは、顧客固有のプロファイル、ユーザーとの対話履歴、その他の関連データなどを活用して、各顧客に合わせたよりパーソナライズされた体験を提供できるようになります。\nBlueprint は、企業独自のユース ケースに合わせてカスタマイズが可能な ”土台” のようなものです。たとえば、\nNemotron 4 Hindi 4B Instruct\nなど他の NIM マイクロサービスを統合すれば、AI バーチャル アシスタントが現地の言語でコミュニケーションできるようになります。その他のマイクロサービスにより、合成データの生成やモデルのファインチューニングなどの追加機能が可能になり、特定のユース ケース要件に適合させることができます。また、デジタル ヒューマン AI Blueprint に接続すると、AI バーチャル アシスタントに人間のようなインターフェイスが提供されます。\n独自のデータ (企業やユーザーのプロファイル、特定のデータ) を備えた RAG バックエンドを実装することで、AI バーチャル アシスタントは、文脈に沿った対話を行い、リアルタイムで各顧客のニーズの特定事項に対応することができます。さらに、このソリューションはすでに運用しているガバナンス フレームワーク内で安全に運用され、特に機密データを扱う際には、プライバシーとセキュリティ プロトコルの遵守を保証します。\n独自の AI バーチャル アシスタントを構築する 3 つの構成要素\n開発者として、最も関連性の高い最新の情報をリアルタイムで取得し、常に人間のような応答ができるよう日々進化する独自の AI バーチャル アシスタントを構築できます。図 1 は、3 つの機能コンポーネントを含む AI バーチャル アシスタントのアーキテクチャ図です。\n図 1. AI バーチャル アシスタント向けの NVIDIA AI Blueprint\n1. データの取り込みと検索パイプライン\nパイプライン管理者は、取り込み (Ingest) パイプラインを使用して、構造化データや非構造化データをデータベースに読み込むことができます。構造化データの例として、顧客プロファイル、注文履歴、発送状況などがあります。非構造化データには、製品マニュアル、製品カタログ、FAQ ドキュメントなどのサポート資料が含まれます。\n2. AI エージェント\n2 つ目の機能コンポーネントは AI バーチャル アシスタント です。ユーザーは、ユーザー インターフェイスを介してバーチャル アシスタントと対話します。エージェント型 LLM プログラミング フレームワークである LangGraph で実装された AI エージェントが、顧客からの複雑な問い合わせに対応する方法を計画し、その問い合わせを再帰的に解決します。LangGraph エージェントは\nLlama3.1 70B Instruct NIM\nのツール呼び出し機能を使用して、非構造化データと構造化データの両方から情報を取得し、正確な応答を生成します。\nまた AI エージェントにより、短期メモリと長期メモリの機能を使用してマルチターンの対話履歴を実現できます。アクティブな会話に対する問い合わせや応答が埋め込まれているため、会話の後半で追加の文脈として検索し利用できます。これにより、より人間に近いやりとりが可能になり、顧客がすでにエージェントと共有した情報を繰り返す提供する必要がなくなります。\n最終的に、会話の最後に AI エージェントが感情の判定とともに議論を要約し、構造化データベースに会話履歴を保存します。ユーザーとの対話は、今後の会話で追加の文脈として検索できます。通話の要約と会話履歴を検索することで、通話時間を短縮し、顧客体験を向上させることができます。感情判定によって、エージェントの有効性に関する貴重な洞察をカスタマー サービス管理者に提供できます。\n3. 運用パイプライン\n顧客運用パイプラインは、ソリューション全体の 3 つ目の構成要素です。このパイプラインは、カスタマー サービス オペレーターに重要な情報と洞察を提供します。管理者は、運用パイプラインを使用して、チャット履歴、ユーザーのフィードバック、感情分析データ、通話の要約を確認することができます。Llama 3.1 70B Instruct NIM を活用した分析マイクロサービスを使用して、平均通話時間、解決までの時間、顧客満足度などの分析を生成できます。また分析結果は、ユーザー フィードバックとしても活用され、LLM モデルを再トレーニングして精度を向上します。\nNVIDIA パートナーと本番環境に着手\nNVIDIA のコンサルティング パートナーは、各企業が、NVIDIA アクセラレーテッド コンピューティングと、NeMo、NIM マイクロサービス、AI Blueprint を含む\nNVIDIA AI Enterprise ソフトウェア\nで構築された世界水準の AI バーチャル アシスタントを導入できるように支援しています。\nAccenture\nNVIDIA AI Foundry\n上に構築された\nAccenture AI Refinery\nは、自律的で顧客の意図に沿った対話を設計し、企業がデジタル ヒューマンやインタラクション エージェントなどの革新的なチャネルを通じて、個人に合わせてカスタマイズできるようにします。特定のユース ケースは、通信会社のコール センター、保険契約のアドバイザー、医薬品のインタラクティブ エージェント、自動車ディーラーのネットワーク エージェントなど、各業界のニーズに合わせてカスタマイズできます。\nDeloitte\nDeloitte Frontline AI は、NVIDIA ACE、NVIDIA Omniverse、NVIDIA Riva、NIM などの NVIDIA のテクノロジによって加速された NVIDIA AI Blueprint を利用して構築されたデジタル アバターや LLM エージェントでカスタマー サービス体験を向上しています。\nWipro\nWipro Enterprise Generative AI (WeGA) Studio は、ヘルスケア、金融サービス、小売などのコンタクト センターのエージェントを含む業界固有のユース ケースを加速しています。\nTech Mahindra\nTech Mahindra は、デジタル ヒューマン向けの NVIDIA AI Blueprint を活用して、カスタマー サービス向けのソリューションを構築しています。RAG と NVIDIA NeMo を使用したこのソリューションは、トレーニング受講者が、会話中に手を挙げて明確な質問をすることで、エージェントを止める機能を提供します。このシステムは、多くの業界のユース ケースでデプロイできる洗練された学習管理システムで、バックエンドのマイクロサービスと接続するように設計されています。\nInfosys\nInfosys Topaz\nの一部である\nInfosys Cortex\nは、AI を活用した顧客エンゲージメント プラットフォームであり、生成 AI、スピーチ AI、デジタル ヒューマン機能を実現する NVIDIA AI Blueprint と NVIDIA NeMo、Riva、ACE 技術を統合し、カスタマー サービス組織のあらゆるメンバーに専門的で個人に合わせたプロアクティブかつオンデマンドの支援を提供することで、顧客体験の向上、運用効率の改善、コスト削減に重要な役割を果たします。\nTata Consultancy Services\nNVIDIA NIM を搭載し ServiceNow の IT 仮想エージェントと統合された Tata Consultancy Services (TCS) の仮想エージェントは、IT と HR のサポートを最適化するように設計されています。このソリューションは、プロンプト チューニングと RAG を使用して、応答時間、精度を向上させ、マルチターンの会話機能を提供します。サービス デスクのコスト削減、サポート チケットの減少、ナレッジ活用の強化、より迅速なデプロイ、そして従業員と顧客の全体的な体験の向上などのメリットがあります。\nQuantiphi\nQuantiphi\nは、NVIDIA AI Blueprint を対話型 AI ソリューションに統合し、リアルなデジタル アバターでカスタマー サービスを強化しています。NVIDIA Tokkio と ACE、\nNVIDIA NIM マイクロサービス\n、\nNVIDIA NeMo\nを搭載した最先端のアバターが、既存のエンタープライズ アプリケーションとシームレスに統合し、リアリティを高めながら運用と顧客体験を向上させます。デジタル アバター ワークフローにファインチューニングされた NIM のデプロイは、費用対効果が高く、企業のトークンに対する支出を削減することが実証されています。\nSoftServe\nSoftServe Digital Concierge\nは、NVIDIA AI Blueprint と NVIDIA NIM マイクロサービスによって加速されており、NVIDIA ACE、NVIDIA Riva、NVIDIA Audio2Face NIM マイクロサービスを使用して、非常にリアルなバーチャル アシスタントを提供します。Character Creator ツールを使用することで、音声や顔の表情を驚くほど正確か��リアルに詳細を再現できます。\nNVIDIA NeMo Retriever の RAG 機能により、SoftServe Digital Concierge は、文脈を参照し、特定の最新情報を提供することで、顧客からの問い合わせにインテリジェントに対応できます。複雑な問い合わせを簡素化し、明確で簡潔な回答にまとめ、必要に応じて詳細な説明を提供することもできます。\nEXL\nEXL の Smart Agent Assist 製品は、NVIDIA Riva、NVIDIA NeMo、NVIDIA NIM マイクロサービスを活用したコンタクト センター AI ソリューションです。EXL は、AI 仮想エージェント向けの NVIDIA AI Blueprint を使用して、ソリューションを強化する予定です。\nNVIDIA AI Summit India\nで、NVIDIA コンサルティング パートナーが、インドを AI のフロント オフィスに変革するために、NVIDIA とのコラボレーションを発表しました。NVIDIA テクノロジを使用することで、これらのコンサルティング大手は、顧客がカスタマー サービス エージェントの Blueprint をカスタマイズし、好みの AI モデル (インドに拠点を置くモデル メーカーが提供するソブリン LLM を含む) を使用して独自のバーチャル アシスタントを構築し、希望のインフラで効率的に本番稼動できるようにします。\n今すぐ始める\nBlueprint を無料で試したり、システム要件を確認するには、\nBlueprint カード\nをご参照ください。これらのマイクロサービスを使用してアプリケーションの構築を始めるには、\nNVIDIA API カタログ\nにアクセスしてください。\nサインイン\nするには、NIM で構築するさまざまなオプションにアクセスするため、個人用またはビジネス用のメール アドレスを入力する必要があります。詳細については、\nNVIDIA NIM FAQ\nをご覧ください。\n関連情報\nGTC セッション:\n金融部門向けの安全で効率的なバーチャル アシスタント\nGTC セッション:\n生成 AI の課題への対応と可能性の活用: NVIDIA のエンタープライズ デプロイから得られた洞察\nNGC コンテナー:\nretail-shopping-advisor-chatbot-service\nNGC コンテナー:\nretail-shopping-advisor-frontend-service\nウェビナー:\n金融サービス コンタクト センター向けの AI 音声対応バーチャル アシスタントの構築と導入方法\nウェビナー:\n通信企業が対話型 AI で顧客体験を変革する方法"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/hymba-hybrid-head-architecture-boosts-small-language-model-performance\/","en_title":"Hymba Hybrid-Head Architecture Boosts Small Language Model Performance","en_content":"Transformers, with their attention-based architecture, have become the dominant choice for language models (LMs) due to their strong performance, parallelization capabilities, and long-term recall through key-value (KV) caches. However, their quadratic computational cost and high memory demands pose efficiency challenges. In contrast, state space models (SSMs) like Mamba and Mamba-2 offer constant complexity and efficient hardware optimization but struggle with memory recall tasks, affecting their performance on general benchmarks.\nNVIDIA researchers recently proposed\nHymba\n, a family of small language models (SLMs) featuring a hybrid-head parallel architecture that integrates transformer attention mechanisms with SSMs to achieve both enhanced efficiency and improved performance. In Hymba, attention heads provide high-resolution recall, while SSM heads enable efficient context summarization.\nThe novel architecture of Hymba reveals several insights:\nOverhead in attention:\nOver 50% of attention computation can be replaced by cheaper SSM computation.\nLocal attention dominance:\nMost global attention can be replaced by local attention without sacrificing performance on general and recall-intensive tasks, thanks to the global information summarized by SSM heads.\nKV cache redundancy:\nKey-value cache is highly correlated across heads and layers, so it can be shared across heads (group query attention) and layers (cross-layer KV cache sharing).\nSoftmax attention limitation:\nAttention mechanisms are constrained to sum to one, limiting sparsity, and flexibility. We introduce learnable meta-tokens that are prepended to prompts, storing critical information and alleviating the “forced-to-attend” burden associated with attention mechanisms.\nThis post shows that Hymba 1.5B performs favorably against state-of-the-art open-source models of similar size, including Llama 3.2 1B, OpenELM 1B, Phi 1.5, SmolLM2 1.7B, Danube2 1.8B, and Qwen2.5 1.5B. Compared to Transformer models of similar size, Hymba also achieves higher throughput and requires 10x less memory to store cache.\nHymba 1.5B is released to the\nHugging Face\ncollection and\nGitHub\n.\nHymba 1.5B performance\nFigure 1 compares Hymba 1.5B against sub-2B models (Llama 3.2 1B, OpenELM 1B, Phi 1.5, SmolLM2 1.7B, Danube2 1.8B, Qwen2.5 1.5B) in terms of average task accuracy, cache size (MB) relative to sequence length, and throughput (tok\/sec).\nFigure 1. Performance comparison of Hymba 1.5B Base against sub-2B models\nIn this set of experiments, the tasks include MMLU, ARC-C, ARC-E, PIQA, Hellaswag, Winogrande, and SQuAD-C. The throughput is measured on an NVIDIA A100 GPU with a sequence length of 8K and a batch size of 128 using PyTorch. For models encountering out of memory (OOM) issues during throughput measurement, the batch size was halved until the OOM is resolved to measure the maximal achievable throughput without OOM.\nHymba model design\nSSMs such as Mamba were introduced to address the quadratic complexity and large inference-time KV cache issues of transformers. However, due to their low-resolution memory, SSMs struggle with memory recall and performance. To overcome these limitations, we propose a road map for developing efficient and high-performing small LMs in Table 1.\nConfiguration\nCommonsense reasoning (%) ↑\nRecall (%) ↑\nThroughput (token\/sec) ↑\nCache size (MB) ↓\nDesign reason\nAblations on 300M model size and 100B training tokens\nTransformer (Llama)\n44.08\n39.98\n721.1\n414.7\nAccurate recall while inefficient\nState-space models (Mamba)\n42.98\n19.23\n4720.8\n1.9\nEfficient while inaccurate recall\nA. + Attention heads (sequential)\n44.07\n45.16\n776.3\n156.3\nEnhance recall capabilities\nB. + Multi-head heads (parallel)\n45.19\n49.90\n876.7\n148.2\nBetter balance of two modules\nC. + Local \/ global attention\n44.56\n48.79\n2399.7\n41.2\nBoost compute\/cache efficiency\nD. + KV cache sharing\n45.16\n48.04\n2756.5\n39.4\nCache efficiency\nE. + Meta-tokens\n45.59\n51.79\n2695.8\n40.0\nLearned memory initialization\nScaling to 1.5B model size and 1.5T training tokens\nF. + Size \/ data\n60.56\n64.15\n664.1\n78.6\nFurther boost task performance\nG. + Extended context length (2K→8K)\n60.64\n68.79\n664.1\n78.6\nImprove multishot and recall tasks\nTable 1. Design road map of the Hymba model\nFused hybrid modules\nFusing attention and SSM heads in parallel within a hybrid-head module outperforms sequential stacking, according to the ablation study. Hymba fuses attention and SSM heads in parallel within a hybrid head module, enabling both heads to process the same information simultaneously. This architecture improves reasoning and recall accuracy.\nFigure 2. The hybrid-head module in Hymba\nEfficiency and KV cache optimization\nWhile attention heads improve task performance, they increase KV cache requirements and reduce throughput. To mitigate this, Hymba optimizes the hybrid-head module by combining local and global attention and employing cross-layer KV cache sharing. This improves throughput by 3x and reduces cache by almost 4x without sacrificing performance.\nFigure 3. Hymba model architecture\nMeta-tokens\nA set of 128 pretrained embeddings prepended to inputs, functioning as learned cache initialization to enhance focus on relevant information. These tokens serve a dual purpose:\nMitigating attention drain by acting as backstop tokens, redistributing attention effectively\nEncapsulating compressed world knowledge\nFigure 4. Interpretation of Hymba from the memory aspect\nModel analysis\nThis section presents an apples-to-apples comparison across different architectures under the same training settings. We then visualize the attention maps of SSM and Attention in different pretrained models. Finally, we perform head importance analysis for Hymba through pruning. All the analyses in this section help to illustrate how and why the design choices for Hymba are effective.\nApples-to-apples comparison\nWe performed an apples-to-apples comparison of Hymba, pure Mamba2, Mamba2 with FFN, Llama3 style, and Samba style (Mamba-FFN-Attn-FFN) architectures. All models have 1 billion parameters and are trained from scratch for 100 billion tokens from SmolLM-Corpus with exactly the same training recipe. All results are obtained through lm-evaluation-harness using a zero-shot setting on Hugging Face models. Hymba performs the best on commonsense reasoning as well as question answering and recall-intensive tasks.\nTable 2 compares various model architectures on language modeling and recall-intensive and commonsense reasoning tasks, with Hymba achieving strong performance across metrics. Hymba demonstrates the lowest perplexity in language tasks (18.62 for Wiki and 10.38 for LMB) and solid results in recall-intensive tasks, particularly in SWDE (54.29) and SQuAD-C (44.71), leading to the highest average score in this category (49.50).\nModel\nLanguage (PPL) ↓\nRecall intensive (%) ↑\nCommonsense reasoning (%) ↑\nMamba2\n15.88\n43.34\n52.52\nMamba2 w\/ FFN\n17.43\n28.92\n51.14\nLlama3\n16.19\n47.33\n52.82\nSamba\n16.28\n36.17\n52.83\nHymba\n14.5\n49.5\n54.57\nTable 2. Comparison of architectures trained on 100 billion tokens under the same settings\nIn commonsense reasoning and question answering, Hymba outperforms other models in most tasks, such as SIQA (31.76) and TruthfulQA (31.64), with an average score of 54.57, slightly above Llama3 and Mamba2. Overall, Hymba stands out as a balanced model, excelling in both efficiency and task performance across diverse categories.\nAttention map visualization\nWe further categorized elements in the attention map into four types:\nMeta:\nAttention scores from all real tokens to meta-tokens. This category reflects the model’s preference for attending to meta-tokens. In attention maps, they are usually located in the first few columns (for example, 128 for Hymba) if a model has meta-tokens.\nBOS:\nAttention scores from all real tokens to the beginning-of-sequence token. In the attention map, they are usually located in the first column right after the meta-tokens.\nSelf:\nAttention scores from all real tokens to themselves. In the attention map, they are usually located in the diagonal line.\nCross:\nAttention scores from all real tokens to other real tokens. In the attention map, they are usually located in the off-diagonal area.\nThe attention pattern of Hymba is significantly different from that of vanilla Transformers. In vanilla Transformers, attention scores are more concentrated on BOS, which is consistent with the findings in Attention Sink. In addition, vanilla Transformers also have a higher proportion of Self attention scores. In Hymba, meta-tokens, attention heads, and SSM heads work complementary to each other, leading to a more balanced distribution of attention scores across different types of tokens.\nSpecifically, meta-tokens offload the attention scores from BOS, enabling the model to focus more on the real tokens. SSM heads summarize the global context, which focuses more on current tokens (Self attention scores). Attention heads, on the other hand, pay less attention to Self and BOS tokens, and more attention to other tokens (that is, Cross attention scores). This suggests that the hybrid-head design of Hymba can effectively balance the attention distribution across different types of tokens, potentially leading to better performance.\nFigure 5. Schematics of the attention map of Hymba as a combination of meta-tokens, sliding window attention, and Mamba contributions\nFigure 6. Sum of the attention score from different categories in Llama 3.2 3B and Hymba 1.5B\nHeads importance analysis\nWe analyzed the relative importance of attention and SSM heads in each layer by removing them and recording the final accuracy. Our analysis reveals the following:\nThe relative importance of attention\/SSM heads in the same layer is input-adaptive and varies across tasks, suggesting that they can serve different roles when handling various inputs.\nThe SSM head in the first layer is critical for language modeling, and removing it causes a substantial accuracy drop to random guess levels.\nGenerally, removing one attention\/SSM head results in an average accuracy drop of 0.24%\/1.1% on Hellaswag, respectively.\nFigure 7. The achieved accuracy, measured using 1K samples from Hellaswag, after removing the Attention or SSM heads in each layer\nModel architecture and training best practices\nThis section outlines key architectural decisions and training methodologies for Hymba 1.5B Base and Hymba 1.5B Instruct.\nModel architecture\nHybrid architecture:\nMamba is great at summarization and usually closer focuses on the current token, while attention is more precise and acts as snapshot memory. Combining them in parallel merges these benefits, but standard sequential fusion does not. We chose a 5:1 parameter ratio between SSM and attention heads.\nSliding window attention:\nFull attention heads are preserved in three layers (first, last, and middle), with sliding window attention heads used in the remaining 90% layers.\nCross-layer KV cache sharing:\nImplemented between every two consecutive attention layers. It is done in addition to GQA KV cache sharing between heads.\nMeta-tokens:\nThese 128 tokens are learnable with no supervision, helping to avoid entropy collapse problems in large language models (LLMs) and mitigate the attention sink phenomenon. Additionally, the model stores general knowledge in these tokens.\nTraining best practices\nPretraining:\nWe opted for two-stage base model training. Stage 1 maintained a constant large learning rate and used less filtered large corpus data. Continuous learning rate decay was then performed to 1e-5 using high-quality data. This approach enables continuous training and resuming of Stage 1.\nInstruction fine-tuning:\nInstruct model tuning is performed in three stages. First, SFT-1 provides the model with strong reasoning abilities by training on code, math, function calling, role play, and other task-specific data. Second, SFT-2 teaches the model to follow human instructions. Finally, DPO is leveraged to align the model with human preferences and improve the model’s safety.\nFigure 8. Training pipeline adapted for the Hymba model family\nPerformance and efficiency evaluation\nWith only 1.5T pretraining tokens, the Hymba 1.5B model performs the best among all small LMs and achieves better throughput and cache efficiency than all transformer-based LMs.\nFor example, when benchmarking against the strongest baseline, Qwen2.5, which is pretrained on 13x more tokens, Hymba 1.5B achieves a 1.55% average accuracy improvement, 1.41x throughput, and 2.90x cache efficiency. Compared to the strongest small LM trained on fewer than 2T tokens, namely h2o-danube2, our method achieves a 5.41% average accuracy improvement, 2.45x throughput, and 6.23x cache efficiency.\nModel\n# Para-ms\nTrain tokens\nToken\nper sec\nCache\n(MB)\nMMLU 5-\nshot\nARC-E 0-shot\nARC-C 0-shot\nPIQA 0-shot\nWino. 0-shot\nHella. 0-shot\nSQuAD -C\n1-shot\nAvg\nOpen\nELM-1\n1.1B\n1.5T\n246\n346\n27.06\n62.37\n19.54\n74.76\n61.8\n48.37\n45.38\n48.57\nRene\nv0.1\n1.3B\n1.5T\n800\n113\n32.94\n67.05\n31.06\n76.49\n62.75\n51.16\n48.36\n52.83\nPhi\n1.5\n1.3B\n0.15T\n241\n1573\n42.56\n76.18\n44.71\n76.56\n72.85\n48\n30.09\n55.85\nSmol\nLM\n1.7B\n1T\n238\n1573\n27.06\n76.47\n43.43\n75.79\n60.93\n49.58\n45.81\n54.15\nCosmo\n1.8B\n.2T\n244\n1573\n26.1\n62.42\n32.94\n71.76\n55.8\n42.9\n38.51\n47.2\nh20\ndan-ube2\n1.8B\n2T\n271\n492\n40.05\n70.66\n33.19\n76.01\n66.93\n53.7\n49.03\n55.65\nLlama 3.2 1B\n1.2B\n9T\n535\n262\n32.12\n65.53\n31.39\n74.43\n60.69\n47.72\n40.18\n50.29\nQwen\n2.5\n1.5B\n18T\n469\n229\n60.92\n75.51\n41.21\n75.79\n63.38\n50.2\n49.53\n59.51\nAMD\nOLMo\n1.2B\n1.3T\n387\n1049\n26.93\n65.91\n31.57\n74.92\n61.64\n47.3\n33.71\n48.85\nSmol\nLM2\n1.7B\n11T\n238\n1573\n50.29\n77.78\n44.71\n77.09\n66.38\n53.55\n50.5\n60.04\nLlama\n3.2 3B\n3.0B\n9T\n191\n918\n56.03\n74.54\n42.32\n76.66\n69.85\n55.29\n43.46\n59.74\nHymba\n1.5B\n1.5T\n664\n79\n51.19\n76.94\n45.9\n77.31\n66.61\n53.55\n55.93\n61.06\nTable 2. Hymba 1.5B Base model results\nInstructed models\nThe Hymba 1.5B Instruct model achieves the highest performance on an average of all tasks, outperforming the previous state-of-the-art model, Qwen 2.5 Instruct, by around 2%. Specifically, Hymba 1.5B surpasses all other models in GSM8K\/GPQA\/BFCLv2 with a score of 58.76\/31.03\/46.40, respectively. These results indicate the superiority of Hymba 1.5B, particularly in areas requiring complex reasoning capabilities.\nModel\n# Params\nMMLU ↑\nIFEval ↑\nGSM8K ↑\nGPQA ↑\nBFCLv2 ↑\nAvg. ↑\nSmolLM\n1.7B\n27.80\n25.16\n1.36\n25.67\n-*\n20.00\nOpenELM\n1.1B\n25.65\n6.25\n56.03\n21.62\n-*\n27.39\nLlama 3.2\n1.2B\n44.41\n58.92\n42.99\n24.11\n20.27\n38.14\nQwen2.5\n1.5B\n59.73\n46.78\n56.03\n30.13\n43.85\n47.30\nSmolLM2\n1.7B\n49.11\n55.06\n47.68\n29.24\n22.83\n40.78\nHymba 1.5B\n1.5B\n52.79\n57.14\n58.76\n31.03\n46.40\n49.22\nTable 3. Hymba 1.5B Instruct model results\nConclusion\nThe new Hymba family of small LMs features a hybrid-head architecture that combines the high-resolution recall capabilities of attention heads with the efficient context summarization of SSM heads. To further optimize the performance of Hymba, learnable meta-tokens are introduced to act as a learned cache for both attention and SSM heads, enhancing the model’s focus on salient information. Through the road map of Hymba, comprehensive evaluations, and ablation studies, Hymba sets new state-of-the-art performance across a wide range of tasks, achieving superior results in both accuracy and efficiency. Additionally, this work provides valuable insights into the advantages of hybrid-head architectures, offering a promising direction for future research in efficient LMs.\nLearn more about\nHybma 1.5B Base\nand\nHymba 1.5B Instruct\n.\nAcknowledgments\nThis work would not have been possible without contributions from many people at NVIDIA, including Wonmin Byeon, Zijia Chen, Ameya Sunil Mahabaleshwarkar, Shih-Yang Liu, Matthijs Van Keirsbilck, Min-Hung Chen, Yoshi Suhara, Nikolaus Binder, Hanah Zhang, Maksim Khadkevich, Yingyan Celine Lin, Jan Kautz, Pavlo Molchanov, and Nathan Horrocks.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/hymba-hybrid-head-architecture-boosts-small-language-model-performance\/","jp_title":"Hymba ハイブリッド ヘッド アーキテクチャが小規模言語モデルのパフォーマンスを向上","jp_content":"Reading Time:\n4\nminutes\nTransformer は、その Attention ベースのアーキテクチャによる、強力なパフォーマンス、並列化能力、および KV (Key-Value) キャッシュを通じた長期記憶のおかげで、言語モデル (LM) の主流となっています。しかし、二次計算コストと高いメモリ要求により、効率性に課題が生じています。これに対し、Mamba や Mamba-2 のような状態空間モデル (SSMs) は、複雑さを一定にして効率的なハードウェア最適化を提供しますが、メモリ想起タスクが苦手でそれは一般的なベンチマークでのパフォーマンスに影響を与えています。\nNVIDIA の研究者は最近、効率性とパフォーマンスの両方を向上させるために、Transformer の Attention メカニズムを SSM と統合したハイブリッド ヘッド並列アーキテクチャを特徴とする小規模言語モデル (SLM) ファミリである\nHymba\nを提案しました。Hymba では、Attention ヘッドが高解像度の記憶能力を提供し、SSM ヘッドが効率的なコンテキストの要約を可能にします。\nHymba の新たなアーキテクチャは、いくつかの洞察を明らかにしています。\nAttention のオーバーヘッド:\nAttention 計算の 50% 以上を、より安価な SSM 計算に置き換えることができます。\nローカル Attention の優位性:\nSSM ヘッドにより要約されたグローバル情報のおかげで、一般的なタスクやメモリ想起に集中するタスクのパフォーマンスを犠牲にすることなく、ほとんどのグローバル Attention をローカル Attention に置き換えることができます。\nKV キャッシュ冗長性:\nKey-value キャッシュは、ヘッド間とレイヤー間で高い相関性があるため、ヘッド間 (GQA: Group Query Attention) およびレイヤー間 (Cross-layer KV キャッシュ共有) で共有できます。\nSoftmax の Attention の制限:\nAttention メカニズムは、合計が 1 になるように制限されており、疎性と柔軟性に制限があります。NVIDIA は、プロンプトの先頭に学習可能なメタトークンを導入し、重要な情報を格納し、Attention メカニズムに関連する「強制的に Attention を行う」負担を軽減します。\nこの記事では、Hymba 1.5B が同様の規模である最先端のオープンソース モデル、Llama 3.2 1B、OpenELM 1B、Phi 1.5、SmolLM2 1.7B、Danube2 1.8B、Qwen2.5 1.5B などと比較して、良好なパフォーマンスを発揮することが示されています。同等のサイズの Transformer モデルと比較すると、Hymba はより高いスループットを発揮し、キャッシュを保存するために必要なメモリが 10 分の 1 で済みます。\nHymba 1.5B は\nHugging Face\nコレクションと\nGitHub\nで公開されています。\nHymba 1.5B のパフォーマンス\n図 1 は、Hymba 1.5B と 2B 未満のモデル (Llama 3.2 1B、OpenELM 1B、Phi 1.5、SmolLM2 1.7B、Danube2 1.8B、Qwen2.5 1.5B) を、平均タスク精度、シーケンス長に対するキャッシュ サイズ (MB)、スループット (tok\/sec) で比較したものです。\n図 1. Hymba 1.5B Base と 2B 未満のモデルのパフォーマンス比較\nこの一連の実験には、MMLU、ARC-C、ARC-E、PIQA、Hellaswag、Winogrande、SQuAD-C などのタスクが含まれています。スループットは、シーケンス長 8K、バッチ サイズ 128 で PyTorch を使用して NVIDIA A100 GPU で測定します。スループット測定中にメモリ不足 (OOM: Out of Memory) 問題が発生したモデルでは、OOM が解決されるまでバッチ サイズを半分にして、OOM なしで達成可能な最大スループットを測定しました。\nHymba モデルのデザイン\nMamba のような SSM は、Transformer の二次的な複雑性と推論時の KV キャッシュが大きい問題に対処するために導入されました。しかし、メモリ解像度が低いために、SSM は記憶想起とパフォーマンスの点で苦戦しています。これらの制限を克服するために、表 1 で効率的で高性能な小規模言語モデルを開発するためのロードマップを提案します。\n構成\n常識推論 (%) ↑\nリコール (%) ↑\nスループット (token\/sec) ↑\nキャッシュ サイズ (MB) ↓\n設計理由\n300M モデル サイズと 100B トレーニング トークンのアブレーション\nTransformer (Llama)\n44.08\n39.98\n721.1\n414.7\n非効率的ながら正確な記憶\n状態空間モデル (Mamba)\n42.98\n19.23\n4720.8\n1.9\n効率的だが不正確な記憶\nA. + Attention ヘッド (連続)\n44.07\n45.16\n776.3\n156.3\n記憶能力を強化\nB. + 複数ヘッド (並列)\n45.19\n49.90\n876.7\n148.2\n2 つのモジュールのバランスの改善\nC. + ローカル \/ グローバル Attention\n44.56\n48.79\n2399.7\n41.2\n演算 \/ キャッシュの効率を向上\nD. + KV キャッシュ共有\n45.16\n48.04\n2756.5\n39.4\nキャッシュ効率化\nE. + メタトークン\n45.59\n51.79\n2695.8\n40.0\n学習した記憶の初期化\n1.5B モデル サイズと 1.5T トレーニング トークンへのスケーリング\nF. + サイズ \/ データ\n60.56\n64.15\n664.1\n78.6\nタスク パフォーマンスのさらなる向上\nG. + コンテキスト長の拡張 (2K→8K)\n60.64\n68.79\n664.1\n78.6\nマルチショットとリコール タスクの改善\n表 1. Hymba モデルのデザイン ロードマップ\n融合型ハイブリッド モジュール\nアブレーション研究によると、ハイブリッド ヘッド モジュール内で Attention と SSM ヘッドを並列にして融合するほうが、シーケンシャルにスタッキングするより優れていることが分かっています。Hymba は、ハイブリッド ヘッド モジュール内で Attention と SSM ヘッドを並列に融合させ、両ヘッドが同時に同じ情報を処理できるようにします。このアーキテクチャは、推論と記憶の正確さを高めます。\n図 2. Hymba のハイブリッド ヘッド モジュール\n効率性と KV キャッシュの最適化\nAttention ヘッドはタスクのパフォーマンスを向上させますが、KV キャッシュの要求を増大させ、スループットを低下させます。これを緩和するために、Hymba はローカルおよびグローバルの Attention を組み合わせ、 Cross-layer KV キャッシュ共有を採用することで、ハイブリッド ヘッド モジュールを最適化します。これにより、パフォーマンスを犠牲にすることなくスループットが 3 倍向上し、キャッシュがほぼ 4 分の 1 に削減されます。\n図 3. Hymba モデルのアーキテクチャ\nメタトークン\n入力の先頭に置かれる 128 の事前学習済みの埋め込みのセットであり、学習済みキャッシュの初期化として機能し、関連情報への注意を強化します。このようなトークンには 2 つの目的があります。\nバックストップ トークンとして機能し、Attention を効果的に再分配することで Attention の流出を軽減する\n圧縮された世界知識をカプセル化する\n図 4. メモリの側面から見た Hymba の解釈\nモデル解析\nこのセクションでは、同一のトレーニング設定における異なるアーキテクチャを比較する方法を紹介します。それから、SSM と Attention の Attention マップを異なる学習済みモデルで可視化し、最後に、剪定 (pruning) を通じて Hymba のヘッド重要度分析を行います。このセクションのすべての分析は、Hymba のデザインにおける選択の仕組みと、それが効果的な理由を説明するのに役立ちます。\n同一条件での比較\nHymba、純粋な Mamba2、Mamba2 と FFN、Llama3 スタイル、Samba スタイル (Mamba-FFN-Attn-FFN) のアーキテクチャを同一条件で比較しました。すべてのモデルが 10 億のパラメーターで、まったく同じトレーニング レシピで SmolLM-Corpus から 1,000 億トークンをゼロから学習しています。すべての結果は、Hugging Face モデルでゼロショット設定を使用して lm-evaluation-harness を通じて取得されています。Hymba は、常識推論だけでなく、質問応答タスクや記憶想起タスクでも最高のパフォーマンスを発揮します。\n表 2 は、言語モデリングタスクと記憶想起タスクおよび常識推論タスクに関するさまざまなモデル アーキテクチャを比較しており、Hymba はすべての評価基準で卓越したパフォーマンスを達成しています。Hymba は、言語モデリングタスクで最も低い Perplexity を示し (Wiki で 18.62、LMB で 10.38)、特に SWDE (54.29) と SQuAD-C (44.71) の記憶想起タスクにおいて堅実な結果を示し、このカテゴリで最高の平均スコア (49.50) を達成しました。\nモデル\n言語モデリング (PPL) ↓\n記憶想起型 (%) ↑\n常識推論 (%) ↑\nMamba2\n15.88\n43.34\n52.52\nMamba2 と FFN\n17.43\n28.92\n51.14\nLlama3\n16.19\n47.33\n52.82\nSamba\n16.28\n36.17\n52.83\nHymba\n14.5\n49.5\n54.57\n表 2. 同じ設定で 1,000 億トークンで学習されたアーキテクチャの比較\n常識推論と質問応答において、Hymba は平均スコア 54.57 で、 SIQA (31.76) や TruthfulQA (31.64) などのほとんどのタスクで、Llama3 や Mamba2 をやや上回っています。全体的に、Hymba はバランスの取れたモデルとして際立っており、多様なカテゴリで効率性とタスク パフォーマンスの両方で優れています。\nAttention マップの可視化\nさらに、Attention マップの要素を 4 つのタイプに分類しました。\nMeta:\nすべての実トークンからメタトークンへの Attention スコア。このカテゴリは、モデルがメタトークンに Attention を向ける傾向を反映するものです。Attention マップでは、通常、モデルにメタトークンがある場合、最初の数列 (例えば Hymba の場合は 128) に位置しています。\nBOS:\nすべての実トークンからセンテンスの開始トークンまでの Attention スコア。Attention マップでは、通常、メタトークンの直後の最初の列に位置します。\nSelf:\nすべての実トークンからそれ自身への Attention スコア。Attention マップでは、通常、対角線上に位置しています。\nCross:\nすべての実トークンから他の実トークンへの Attention スコア。Attention マップでは、通常、対角線外の領域に位置しています。\nHymba の Attention パターンは、vanilla (加工されていない) Transformer のそれとは大きく異なります。vanilla Transformer の Attention スコアは BOS に集中しており、Attention Sink の結果と一致しています。さらに、vanilla Transformer は、Self-Attention スコアの比率も高くなっています。Hymba では、メタトークン、Attention ヘッド、SSM ヘッドが互いに補完し合うように機能し、異なるタイプのトークン間で、よりバランスの取れた Attention スコアの分布を実現しています。\n具体的には、メタトークンが BOS からの Attention スコアをオフロードすることで、モデルがより実際のトークンに集中できるようになります。SSM ヘッドはグローバルなコンテキストを要約し、現在のトークン (Self-Attention スコア) により重点を置きます。一方、Attention ヘッドは、Self と BOS トークンに対する注意が低く、他のトークン (すなわち、Cross Attention スコア) への注意が高くなります。これは、Hymba のハイブリッド ヘッド デザインが、異なるタイプのトークン間の Attention 分布のバランスを効果的に取ることができ、パフォーマンスの向上につながる可能性があることを示唆しています。\n図 5. メタトークン、Sliding Window Attention、Mamba 貢献の組み合わせによる Hymba の Attention マップの概略図\n図 6. Llama 3.2 3B と Hymba 1.5B の異なるカテゴリからの Attention スコアの合計\nヘッド重要度分析\n各レイヤーのAttention と SSM ヘッドの相対的な重要性を分析するために、それぞれを削除して最終的な精度を記録しました。分析の結果、以下のことが明らかになりました。\n同じレイヤーの  Attention \/ SSM ヘッドの相対的な重要性は入力適応であり、タスクによって異なります。これは、さまざまな入力の処理において、異なる役割を果たす可能性があることを示唆しています。\n最初のレイヤーの SSM ヘッドは言語モデリングタスクに不可欠で、これを削除すると、ランダム推測レベルにまで大幅に精度が低下します。\n一般的に、Attention \/ SSM ヘッドを 1 つ削除すると、Hellaswag ではそれぞれ平均 0.24%\/1.1% 精度が低下します。\n図 7. Hellaswag の 1K サンプルを使用して測定した、各レイヤーの Attention または SSM ヘッドを削除した後の達成精度\nモデル アーキテクチャと学習のベスト プラクティス\nこのセクションでは、Hymba 1.5B Base と Hymba 1.5B Instruct の主要アーキテクチャ上の決定事項と学習方法の概要について説明します。\nモデル アーキテクチャ\nハイブリッド アーキテクチャ:\nMamba は要約に優れ、通常は現在のトークンにより重点を置きます。Attention はより正確でスナップショット メモリとして機能します。標準的なシーケンシャル融合ではなく、並列に組み合わせることで利点を統合することができます。SSM と Attention ヘッド間のパラメーター比は 5:1 を選択しました。\nSliding Window Attention:\n完全な Attention ヘッドは 3 つのレイヤー (最初、最後、中間) に維持され、残りの 90% のレイヤーで Sliding Window Attention ヘッドが使用されます。\nCross-layer KV キャッシュ共有:\n連続する 2 つの Attention レイヤー間に実装されます。これは、ヘッド間の GQA KV キャッシュ共有に加えて行われます。\nメタトークン:\nこれらの 128 トークンは教師なし学習が可能であり、大規模言語モデル (LLM) におけるエントロピー崩壊の問題を回避し、Attention Sink 現象を緩和するのに役立ちます。さらに、モデルはこれらのトークンに一般的な知識を格納します。\n学習のベスト プラクティス\n事前学習:\n2 段階のベースモデル学習を選択しました。ステージ 1 では、一定の高い学習率を維持し、フィルタリングされていない大規模なコーパス データの使用しました。続いて、高品質のデータを用いて 1e-5 まで継続的に学習率を減衰させました。このアプローチにより、ステージ 1 の継続的な学習と再開が可能になります。\n指示ファインチューニング:\n指示モデルの調整は 3 つの段階で行われます。まず、SFT-1 は、コード、数学、関数呼び出し、ロール プレイ、その他のタスク固有のデータで学習を実施し、強力な推論能力をモデルに付与します。次に、SFT-2 はモデルに人間の指示に従うことを教えます。最後に、DPO を活用して、モデルを人間の好みに合わせ、モデルの安全性を高めます。\n図 8. Hymba モデル ファミリに適応した学習パイプライン\nパフォーマンスと効率性の評価\n1.5T の事前学習トークンだけで、Hymba 1.5B モデルはすべての小規模言語モデルの中で最高の性能を発揮し、Transformer ベースの LM よりも優れたスループットとキャッシュ効率を実現します。\n例えば、13 倍以上のトークン数で事前学習された最も強力なベースラインである Qwen2.5 に対してベンチマークした場合、Hymba 1.5B は平均精度が 1.55%、スループットが 1.41 倍、キャッシュ効率が 2.90 倍に向上します。2T 未満のトークンで学習された最も強力な小規模言語モデル、すなわち h2o-danube2 と比較すると、この方法は平均精度が 5.41%、スループットが 2.45 倍、キャッシュ効率が 6.23 倍に向上しています。\nモデル\nパラメーター数\n学習トークン\nトークン\n(1 秒あたり)\nキャッシュ\n(MB)\nMMLU 5-\nshot\nARC-E 0-shot\nARC-C 0-shot\nPIQA 0-shot\nWino. 0-shot\nHella. 0-shot\nSQuAD -C\n1-shot\n平均\nOpenELM-1\n1.1B\n1.5T\n246\n346\n27.06\n62.37\n19.54\n74.76\n61.8\n48.37\n45.38\n48.57\nRenev0.1\n1.3B\n1.5T\n800\n113\n32.94\n67.05\n31.06\n76.49\n62.75\n51.16\n48.36\n52.83\nPhi1.5\n1.3B\n0.15T\n241\n1573\n42.56\n76.18\n44.71\n76.56\n72.85\n48\n30.09\n55.85\nSmolLM\n1.7B\n1T\n238\n1573\n27.06\n76.47\n43.43\n75.79\n60.93\n49.58\n45.81\n54.15\nCosmo\n1.8B\n.2T\n244\n1573\n26.1\n62.42\n32.94\n71.76\n55.8\n42.9\n38.51\n47.2\nh20dan-ube2\n1.8B\n2T\n271\n492\n40.05\n70.66\n33.19\n76.01\n66.93\n53.7\n49.03\n55.65\nLlama 3.2 1B\n1.2B\n9T\n535\n262\n32.12\n65.53\n31.39\n74.43\n60.69\n47.72\n40.18\n50.29\nQwen2.5\n1.5B\n18T\n469\n229\n60.92\n75.51\n41.21\n75.79\n63.38\n50.2\n49.53\n59.51\nAMDOLMo\n1.2B\n1.3T\n387\n1049\n26.93\n65.91\n31.57\n74.92\n61.64\n47.3\n33.71\n48.85\nSmolLM2\n1.7B\n11T\n238\n1573\n50.29\n77.78\n44.71\n77.09\n66.38\n53.55\n50.5\n60.04\nLlama3.2 3B\n3.0B\n9T\n191\n918\n56.03\n74.54\n42.32\n76.66\n69.85\n55.29\n43.46\n59.74\nHymba\n1.5B\n1.5T\n664\n79\n51.19\n76.94\n45.9\n77.31\n66.61\n53.55\n55.93\n61.06\n表 2. Hymba 1.5B ベース モデルの結果\n指示モデル\nHymba 1.5B Instruct モデルは、全タスク平均で最高のパフォーマンスを達成し、直近の最高性能モデルである Qwen 2.5 Instruct を約 2% 上回りました。特に、Hymba 1.5B は GSM8K\/GPQA\/BFCLv2 で、それぞれ 58.76\/31.03\/46.40 のスコアで他のすべてのモデルを上回っています。これらの結果は、特に複雑な推論能力を必要とする分野において、Hymba 1.5B の優位性を示しています。\nモデル\nパラメーター数\nMMLU ↑\nIFEval ↑\nGSM8K ↑\nGPQA ↑\nBFCLv2 ↑\n平均↑\nSmolLM\n1.7B\n27.80\n25.16\n1.36\n25.67\n-*\n20.00\nOpenELM\n1.1B\n25.65\n6.25\n56.03\n21.62\n-*\n27.39\nLlama 3.2\n1.2B\n44.41\n58.92\n42.99\n24.11\n20.27\n38.14\nQwen2.5\n1.5B\n59.73\n46.78\n56.03\n30.13\n43.85\n47.30\nSmolLM2\n1.7B\n49.11\n55.06\n47.68\n29.24\n22.83\n40.78\nHymba 1.5B\n1.5B\n52.79\n57.14\n58.76\n31.03\n46.40\n49.22\n表 3. Hymba 1.5B Instruct モデルの結果\nまとめ\n新しい Hymba ファミリの小規模言語モデルは、ハイブリッド ヘッド アーキテクチャを採用し、Attention ヘッドの高解像な記憶能力と SSM ヘッドの効率的なコンテキストの要約を組み合わせています。Hymba のパフォーマンスをさらに最適化するために、学習可能なメタトークンが導入され、Attention ヘッドと SSM ヘッドの両方で学習済みキャッシュとして機能し、顕著な情報に注目するモデルの精度を強化しました。Hymba のロードマップ、包括的な評価、アブレーション研究を通じて、Hymba は幅広いタスクにわたって新たな最先端のパフォーマンスを確立し、正確さと効率性の両面で優れた結果を達成しました。さらに、この研究は、ハイブリッド ヘッド アーキテクチャの利点に関する貴重な洞察をもたらし、効率的な言語モデルの今後の研究に有望な方向性を示しています。\nHybma 1.5B Base\nと\nHymba 1.5B Instruct\nの詳細はこちらをご覧ください。\n謝辞\nこの成果は、Wonmin Byeon、Zijia Chen、Ameya Sunil Mahabaleshwarkar、Shih-Yang Liu、Matthijs Van Keirsbilck、Min-Hung Chen、Yoshi Suhara、Nikolaus Binder、Hanah Zhang、Maksim Khadkevich、Yingyan Celine Lin、Jan Kautz、Pavlo Molchanov、Nathan Horrocks など、NVIDIA の多くのメンバーの貢献なくしては実現しませんでした。\n関連情報\nGTC セッション:\nOptimizing Large Language Models: An Experimental Approach to Pruning and Fine-Tuning LLama2 7B (大規模言語モデルの最適化: LLama2 7B の剪定とファインチューニングの実験的アプローチ)\nGTC セッション:\nAccelerating End-to-End Large Language Models System using a Unified Inference Architecture and FP8 (統一推論アーキテクチャと FP8 を用いたエンドツーエンドの大規模言語モデル システムの高速化)\nNGC コンテナー:\nLlama-3.1-Nemotron-70B-Ins\ntruct\nNGC コンテナー:\nLlama-3-Swallow-70B-Instruct-v0.1\nSDK:\nNeMo Megatron"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/deploying-fine-tuned-ai-models-with-nvidia-nim\/","en_title":"Deploying Fine-Tuned AI Models with NVIDIA NIM","en_content":"For organizations adapting AI foundation models with domain-specific data, the ability to rapidly create and deploy fine-tuned models is key to efficiently delivering value with enterprise generative AI applications.\nNVIDIA NIM\noffers prebuilt, performance-optimized inference microservices for the latest AI foundation models, including\nseamless deployment\nof models customized using parameter-efficient fine-tuning (PEFT).\nIn some cases, it’s ideal to use methods like continual pretraining, DPO, supervised fine-tuning (SFT), or model merging, where the underlying model weights are adjusted directly in the training or customization process, unlike PEFT with low-rank adaptation (LoRA). In these cases, inference software configuration for the model must be updated for optimal performance given the new weights.\nRather than burden you with this often lengthy process, NIM can automatically build a\nTensorRT-LLM\ninference engine performance optimized for the adjusted model and GPUs in your local environment, and then load it for running inference as part of a single-step model deployment process.\nIn this post, we explore how to rapidly deploy NIM microservices for models that have been customized through SFT by using locally built, performance-optimized TensorRT-LLM inference engines. We include all the necessary commands as well as some helpful options, so you can try it out on your own today.\nPrerequisites\nTo run this tutorial, you need an NVIDIA-accelerated compute environment with access to 80 GB of GPU memory and which has\ngit-lfs\ninstalled.\nBefore you can pull and deploy a NIM microservice in an NVIDIA-accelerated compute environment, you also need an NGC API key.\nNavigate to the\nMeta Llama 3 8B Instruct\nmodel listing in the NVIDIA API Catalog.\nChoose\nLogin\nat the top right and follow the instructions.\nWhen you’re logged in, choose\nBuild with this NIM\non the\nmodel page\n.\nChoose\nSelf-Hosted API\nand follow either option to access NIM microservices access:\nNVIDIA Developer Program membership with free access to NIM for research, development, and testing only.\nThe 90-day NVIDIA AI Enterprise license, which includes access to NVIDIA Enterprise Support.\nAfter you provide the necessary details for your selected access method, copy your NGC API key and be ready to move forward with NIM. For more information, see\nLaunch NVIDIA NIM for LLMs\n.\nGetting started with NIM microservices\nProvide your NGC CLI API key as an environment variable in your compute environment:\nexport NGC_API_KEY=<>\nYou also must point to, create, and modify permissions for a directory to be used as a cache during the optimization process:\nexport NIM_CACHE_PATH=\/tmp\/nim\/.cache\nmkdir -p $NIM_CACHE_PATH\nchmod -R 777 $NIM_CACHE_PATH\nTo demonstrate locally built, optimized TensorRT-LLM inference engines for deploying fine-tuned models with NIM, you need a model that has undergone customization through SFT. For this tutorial, use the\nNVIDIA OpenMath2-Llama3.1-8B\nmodel, which is a customization of\nMeta’s Llama-3.1-8B\nusing the\nOpenMathInstruct-2\ndataset.\nThe base model must be available as a downloadable NIM for LLMs. For more information about downloadable NIM microservices, see the\nNIM Type: Run Anywhere filter\nin the NVIDIA API Catalog.\nAll you need is the weights to this model, which can be obtained in several ways. For this post, clone the model repository using the following commands:\ngit lfs install\ngit clone https:\/\/huggingface.co\/nvidia\/OpenMath2-Llama3.1-8B\nexport MODEL_WEIGHT_PARENT_DIRECTORY=$PWD\nNow that you have the model weights collected, move on to the next step: firing up the microservice.\nSelecting from available performance profiles\nBased on your selected model and hardware configuration, the most applicable inference performance profile available is automatically selected. There are two available performance profiles for local inference engine generation:\nLatency:\nFocused on delivering a NIM microservice that is optimized for latency.\nThroughput:\nFocused on delivering a NIM microservice that is optimized for batched throughput.\nFor more information about supported features, including available precision, see the\nSupport Matrix\ntopic in the NVIDIA NIM documentation.\nExample using an SFT model\nCreate a locally built TensorRT-LLM inference engine for OpenMath2-Llama3.1-8B by running the following commands:\ndocker run -it --rm --gpus all \\\n--user $(id -u):$(id -g)\\\n\t--network=host \\\n\t--shm-size=32GB \\\n\t-e NGC_API_KEY \\\n\t-e NIM_FT_MODEL=\/opt\/weights\/hf\/OpenMath2-Llama3.1-8B \\\n\t-e NIM_SERVED_MODEL_NAME=OpenMath2-Llama3.1-8B \\\n-v $NIM_CACHE_PATH:\/opt\/nim\/.cache \\\n-v $MODEL_WEIGHT_PARENT_DIRECTORY:\/opt\/weights\/hf \\\nnvcr.io\/nim\/meta\/llama-3.1-8b-instruct:1.3.0\nThe command is nearly identical to the typical command you’d use to deploy a NIM microservice. In this case, you’ve added the extra\nNIM_FT_MODEL\nparameter, which points to the OpenMath2-Llama3.1-8B model.\nWith that, NIM builds an optimized inference engine locally. To perform inference using this new NIM microservice, run the following Python code example:\nfrom openai import OpenAI\n\nclient = OpenAI(\n base_url = \"http:\/\/localhost:8000\/v1\",\n api_key = \"none\"\n)\n\ncompletion = client.chat.completions.create(\n model=\"OpenMath2-Llama3.1-8B\",\n messages=[{\"role\":\"user\",\"content\":\"What is your name?\"}],\n temperature=0.2,\n top_p=0.7,\n max_tokens=100,\n stream=True\n)\n\nfor chunk in completion:\n if chunk.choices[0].delta.content is not None:\n print(chunk.choices[0].delta.content, end=\"\")\nVideo 1. How to Deploy Fine-Tuned AI Models\nBuilding an optimized TensorRT-LLM engine with a custom performance profile\nOn\nsupported GPUs\n, you can use a similar command to spin up your NIM microservice. Follow the\nModel Profile\ninstructions to launch your microservice and determine which profiles are accessible for it.\nexport IMG_NAME=\"nvcr.io\/nim\/meta\/llama-3.1-8b-instruct:1.3.0\"\ndocker run --rm --gpus=all -e NGC_API_KEY=$NGC_API_KEY $IMG_NAME list-model-profiles\nAssuming you’re in an environment with two (or more) H100 GPUs, you should see the following profiles available:\ntensorrt_llm-h100-bf16-tp2–pp1-throughput\ntensorrt_llm-h100-bf16-tp2-pp1-latency\nRe-run the command and provide an additional environment variable to specify the desired profile:\ndocker run --rm --gpus=all \\\n -e NGC_API_KEY \\\n -e NIM_FT_MODEL=\/opt\/weights\/hf\/OpenMath2-Llama3.1-8B \\\n -e NIM_SERVED_MODEL_NAME=OpenMath2-Llama3.1-8B \\\n -e NIM_MODEL_PROFILE=tensorrt_llm-h100-bf16-tp2-pp1-latency \\\n -v $NIM_CACHE_PATH:\/opt\/nim\/.cache \\\n -v $MODEL_WEIGHT_PARENT_DIRECTORY:\/opt\/weights\/hf \\\n $IMG_NAME\nNow that you’ve relaunched your NIM microservice with the desired profile, use Python to interact with the model:\nfrom openai import OpenAI\n\nclient = OpenAI(\n base_url = \"http:\/\/localhost:8000\/v1\",\n api_key = \"none\"\n)\n\ncompletion = client.chat.completions.create(\n model=\"llama-3.1-8b-instruct\",\n messages=[{\"role\":\"user\",\"content\":\"What is your name?\"}],\n temperature=0.2,\n top_p=0.7,\n max_tokens=100,\n stream=True\n)\n\nfor chunk in completion:\n if chunk.choices[0].delta.content is not None:\n print(chunk.choices[0].delta.content, end=\"\")\nConclusion\nWhether you’re using\nPEFT\nor SFT methods for model customization, NIM accelerates customized model deployment for high-performance inferencing in a few simple steps. With optimized TensorRT-LLM inference engines built automatically in your local environment, NIM is unlocking new possibilities for rapidly deploying accelerated AI inferencing anywhere.\nLearn more and get started today by visiting the NVIDIA\nAPI catalog\nand checking out the\ndocumentation\n. To engage with NVIDIA and the NIM microservices community, see the NVIDIA\nNIM developer forum\n.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/deploying-fine-tuned-ai-models-with-nvidia-nim\/","jp_title":"NVIDIA NIM でファインチューニングされた AI モデルのデプロイ","jp_content":"Reading Time:\n2\nminutes\nドメイン固有のデータで AI 基盤モデルを適応させている企業にとって、ファインチューニングされたモデルを迅速に作成し、デプロイする能力は、企業の生成 AI アプリケーションで効率的に価値を提供するための鍵となります。\nNVIDIA NIM\nは、Parapeter-efficient Fine-tuning (PEFT) を用いてカスタマイズしたモデルの\nシームレスなデプロイ\nなど、最新の AI 基盤モデル向けにビルドされたパフォーマンスを最適化した推論マイクロサービスを提供します。\n場合によっては、Low-rank Adaptation (LoRA) を使用した PEFT とは異なり、継続事前学習、DPO、教師ありファインチューニング (SFT: Supervised Fine-tuning)、モデル マージなどの手法を利用し、基礎となるモデルの重みをトレーニングやカスタマイズの過程で直接調整するのが理想的です。このような場合、新しい重みを考慮した最適なパフォーマンスを実現するには、モデルの推論ソフトウェア構成を更新する必要があります。\nこの長時間を要するプロセスに負担を割くのではなく、NIM は、調整されたモデルと GPU に合わせて最適化した\nTensorRT-LLM\n推論エンジンをローカル環境でビルドし、ロードし、それを単一ステップのモデル デプロイ プロセスの一環として推論を実行できます。\nこの投稿では、パフォーマンスを最適化した TensorRT-LLM 推論エンジンをローカルでビルドして、SFT でカ��タマイズされたモデルに対する NIM マイクロサービスを迅速にデプロイする方法を説明します。必要なコマンドと便利なオプションもご紹介しますので、是非今すぐお試しください。\n前提条件\nこのチュートリアルを実行するには、80 GB の GPU メモリを持つ NVIDIA アクセラレーテッド コンピューティング環境と\ngit-lfs\nのインストールが必要です。\nNVIDIA アクセラレーテッド コンピューティング環境で、NIM マイクロサービスを pull してデプロイするには、NGC API キーも必要です。\nNVIDIA API カタログのモデル一覧から\nMeta Llama 3 8B Instruct\nに移動します。\n右上の\n[Login]\nを選択し、指示に従ってください。\nログインしたら、\nモデル ページ\nで\n[Build with this NIM]\nを選択します。\n[Self-Hosted API]\nを選択し、いずれかのオプションに従って、NIM マイクロサービスへアクセスします。\nNVIDIA 開発者プログラムのメンバーであれば、研究、開発、テストに限り NIM に無料でアクセスすることができます。\n90 日間の NVIDIA AI Enterprise ライセンスには、NVIDIA Enterprise サポートへのアクセスが含まれています。\n選択したアクセス方法に必要な詳細情報を提供したら、NGC API キーをコピーして、NIM を進める準備をします。詳細については、\nLaunch NVIDIA NIM for LLMs\nを参照してください。\nNIM マイクロサービスをはじめる\n利用中のコンピューティング環境の環境変数として、NGC API キーを提供します。\nexport NGC_API_KEY=<>\nまた、最適化処理中にキャッシュとして使用するディレクトリを作成して、パーミッションを変更して、指定する必要があります。\nexport NIM_CACHE_PATH=\/tmp\/nim\/.cache\nmkdir -p $NIM_CACHE_PATH\nchmod -R 777 $NIM_CACHE_PATH\nNIM でファインチューニングされたモデルをデプロイするために、最適な TensorRT-LLM 推論エンジンをローカルでビルドする実証には、SFT によってカスタマイズしたモデルが必要です。このチュートリアルでは、\nOpenMathInstruct-2\nデータセットを使用して、\nMeta の Llama-3.1-8B\nをカスタマイズした\nNVIDIA OpenMath2-Llama3.1-8B\nモデルを使用します。\nベース モデルは、ダウンロード可能な NIM for LLMs として利用可能でなければなりません。ダウンロード可能な NIM マイクロサービスの詳細については、NVIDIA API カタログの「\nNIM Type: Run Anywhere filter\n」を参照してください。\n必要なのはこのモデルの重みだけで、これはさまざまな方法があります。この投稿では、以下のコマンドを使用してモデル リポジトリをクローンします。\ngit lfs install\ngit clone https:\/\/huggingface.co\/nvidia\/OpenMath2-Llama3.1-8B\nexport MODEL_WEIGHT_PARENT_DIRECTORY=$PWD\nこれでモデルの重みが収集できたので、次のステップのマイクロサービスの起動に進みます。\n利用可能なパフォーマンス プロファイルから選択する\n選択したモデルとハードウェアの構成に基づいて、利用可能なものの中から最も適切な推論パフォーマンス プロファイルが自動的に選択されます。ローカル推論エンジンの生成には、以下の 2 つのパフォーマンス プロファイルが利用できます。\nレイテンシ:\nレイテンシに最適化された NIM マイクロサービスの提供に重点を置きます。\nスループット:\nバッチ スループットに最適化された NIM マイクロサービスの提供に重点を置きます。\n利用可能な精度など、サポート機能の詳細については、NVIDIA NIM ドキュメントの\nサポート情報\nのトピックを参照してください。\nSFT モデルを使用した例\n以下のコマンドを実行して、ローカル環境でビルドした OpenMath2-Llama3.1-8B 用の TensorRT-LLM 推論エンジンを作成します。\ndocker run -it --rm --gpus all \\\n --user $(id -u):$(id -g)\\\n --network=host \\\n --shm-size=32GB \\\n -e NGC_API_KEY \\\n -e NIM_FT_MODEL=\/opt\/weights\/hf\/OpenMath2-Llama3.1-8B \\\n -e NIM_SERVED_MODEL_NAME=OpenMath2-Llama3.1-8B \\\n -v $NIM_CACHE_PATH:\/opt\/nim\/.cache \\\n -v $MODEL_WEIGHT_PARENT_DIRECTORY:\/opt\/weights\/hf \\\n nvcr.io\/nim\/meta\/llama-3.1-8b-instruct:1.3.0\nこのコマンドは、NIM マイクロサービスをデプロイするために使用する典型的なコマンドとほぼ同じです。この場合、追加の NIM_FT_MODEL パラメーターを追加し、OpenMath2-Llama3.1-8B モデルを指しています。\nこれにより、NIM は最適化された推論エンジンをローカル環境でビルドします。この新しい NIM マイ���ロサービスを使用して推論を行うには、以下の Python コード サンプルを実行します。\nfrom openai import OpenAI\n \nclient = OpenAI(\n base_url = \"http:\/\/localhost:8000\/v1\",\n api_key = \"none\"\n)\n \ncompletion = client.chat.completions.create(\n model=\"OpenMath2-Llama3.1-8B\",\n messages=[{\"role\":\"user\",\"content\":\"What is your name?\"}],\n temperature=0.2,\n top_p=0.7,\n max_tokens=100,\n stream=True\n)\n \nfor chunk in completion:\n if chunk.choices[0].delta.content is not None:\n print(chunk.choices[0].delta.content, end=\"\")\n動画 1. ファインチューニングされた AI モデルをデプロイする方法\nカスタム パフォーマンス プロファイルで最適化された TensorRT-LLM エンジンのビルド\nサポートされている GPU\nなら、同様のコマンドを使用して、NIM マイクロサービスを起動できます。\nモデル プロファイル\nの手順に従ってマイクロサービスを起動し、どのプロファイルにアクセスできるかを確認します。\nexport IMG_NAME=\"nvcr.io\/nim\/meta\/llama-3.1-8b-instruct:1.3.0\"\ndocker run --rm --gpus=all -e NGC_API_KEY=$NGC_API_KEY $IMG_NAME list-model-profiles\nH100 GPU を使用していると仮定すると、以下のプロファイルが利用可能であることがわかります。\ntensorrt_llm-h100-bf16-tp2-pp1-latency\ntensorrt_llm-h100-bf16-tp1-pp1-throughput\nコマンドを再実行し、目的のプロファイルを指定する環境変数を追加します。\ndocker run --rm --gpus=all \\\n --user $(id -u):$(id -g)\\\n --network=host \\\n --shm-size=32GB \\\n -e NGC_API_KEY \\\n -e NIM_FT_MODEL=\/opt\/weights\/hf\/OpenMath2-Llama3.1-8B \\\n -e NIM_SERVED_MODEL_NAME=OpenMath2-Llama3.1-8B \\\n -e NIM_MODEL_PROFILE=tensorrt_llm-h100-bf16-tp2-pp1-latency \\\n -v $NIM_CACHE_PATH:\/opt\/nim\/.cache \\\n -v $MODEL_WEIGHT_PARENT_DIRECTORY:\/opt\/weights\/hf \\\n $IMG_NAME\n目的のプロファイルで NIM マイクロサービスを再起動したので、Python を使用してモデルとやり取りします。\nfrom openai import OpenAI\n \nclient = OpenAI(\n base_url = \"http:\/\/localhost:8000\/v1\",\n api_key = \"none\"\n)\n \ncompletion = client.chat.completions.create(\n model=\"llama-3.1-8b-instruct\",\n messages=[{\"role\":\"user\",\"content\":\"What is your name?\"}],\n temperature=0.2,\n top_p=0.7,\n max_tokens=100,\n stream=True\n)\n \nfor chunk in completion:\n if chunk.choices[0].delta.content is not None:\n print(chunk.choices[0].delta.content, end=\"\")\nまとめ\nモデルのカスタマイズに\nPEFT\nまたは SFT を使用している場合でも、NIM は、高性能な推論のためにカスタマイズされたモデルのデプロイをわずかなステップで簡単に高速化します。最適化された TensorRT-LLM 推論エンジンをローカル環境で自動的にビルドすることで、NIM は、高速化された AI 推論をどこにでも迅速にデプロイできるよう新たな可能性を引き出しています。詳細については、\nNVIDIA API カタログ\nにアクセスし、NVIDIA NIM ドキュメントの\nファインチューニングされたモデルのサポート\nをご覧ください。\nNVIDIA NIM 開発者フォーラム\nでは、NVIDIA および NIM マイクロサービス コミュニティとの交流することもできます。\n関連情報\nGTC セッション:\nKubernetes 用 Oracle コンテナー エンジンを使用した OCI の NVIDIA Nemotron LLM のファインチューニングとデプロイ (Oracle 提供)\nGTC セッション:\n企業を加速: 次世代 AI デプロイを実現するツールとテクニック\nGTC セッション:\nNVIDIA NeMo による多様な言語での基盤となる大規模言語モデルのカスタマイズ\nNGC コンテナー:\nPhind-CodeLlama-34B-v2-Instruct\nNGC コンテナー:\nPhi-3-Mini-4K-Instruct\nNGC コンテナー:\nMistral-NeMo-Minitron-8B-Instruct"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/mastering-llm-techniques-data-preprocessing\/","en_title":"Mastering LLM Techniques: Data Preprocessing","en_content":"The advent of\nlarge language models (LLMs)\nmarks a significant shift in how industries leverage AI to enhance operations and services. By automating routine tasks and streamlining processes, LLMs free up human resources for more strategic endeavors, thus improving overall efficiency and productivity.\nTraining and\ncustomizing LLMs\nfor high accuracy is fraught with challenges, primarily due to their dependency on high-quality data. Poor data quality and inadequate volume can significantly reduce model accuracy, making dataset preparation a critical task for AI developers.\nDatasets frequently contain duplicate documents, personally identifiable information (PII), and formatting issues. Some datasets even house toxic or harmful information that poses risks to users. Training models on these datasets without proper processing can result in higher training time and lower model quality. Another significant challenge is the scarcity of data. Model builders are running out of publicly available data to train on, prompting many to turn to third-party vendors or generate synthetic data using advanced LLMs.\nIn this post, we will describe data processing techniques and best practices for optimizing LLM performance by improving data quality for training. We will introduce\nNVIDIA NeMo Curator\nand how it addresses these challenges, demonstrating real-world data processing use cases for LLMs.\nText processing pipelines and best practices\nDealing with the preprocessing of large data is nontrivial, especially when the dataset consists of mainly web-scraped data which is likely to contain large amounts of ill-formatted, low-quality data.\nFigure 1. Text processing pipelines that can be built using NeMo Curator\nFigure 1 shows a comprehensive text processing pipeline, including the following steps at a high-level:\nDownload the dataset from the source and extract to a desirable format such as JSONL.\nApply preliminary text cleaning, such as Unicode fixing and language separation.\nApply both standard and custom-defined filters to the dataset based on specific quality criteria.\nPerform various levels of deduplication (exact, fuzzy, and semantic).\nSelectively apply advanced quality filtering, including model-based quality filtering, PII redaction, distributed data classification, and task decontamination.\nBlend curated datasets from multiple sources to form a unified dataset.\nThe sections below dive deeper into each of these stages.\nDownload and extract text\nThe initial step in data curation involves downloading and preparing datasets from various common sources such as Common Crawl, specialized collections such as arXiv and PubMed, or private on-prime datasets, each potentially containing terabytes of data.\nThis crucial phase requires careful consideration of storage formats and extraction methods, as publicly hosted datasets often come in compressed formats (for example, .warc.gz, tar.gz, or zip files) that need to be converted to more manageable formats (such as .jsonl or .parquet) for further processing.\nPreliminary text cleaning\nUnicode fixing and language identification represent crucial early steps in the data curation pipeline, particularly when dealing with large-scale web-scraped text corpora. This phase addresses two fundamental challenges: improperly decoded Unicode characters, and the presence of multiple languages within the dataset.\nUnicode formatting issues often arise from incorrect character encoding or multiple encoding\/decoding cycles. Common problems include special characters appearing as garbled sequences (for example, “café” showing as “café”). Language identification and separation are equally important, especially for curators who are interested in curating monolingual datasets. Moreover, some of the data curation steps such as heuristic filtering, and model-based quality classifiers are language-specific.\nThis preliminary preprocessing step ensures clean, properly encoded text in identified languages, forming the foundation for all subsequent curation steps.\nHeuristic filtering\nHeuristic filtering employs rule-based metrics and statistical measures to identify and remove low-quality content.\nThe process typically evaluates multiple quality dimensions, such as document length, repetition patterns, punctuation distribution, and structural integrity of the text. Common heuristic filters include:\nWord count filter:\nFilters out snippets that are too brief to be meaningful or suspiciously long.\nBoilerplate string filter:\nIdentifies and removes text containing excessive boilerplate content.\nN-gram repetition filter:\nIdentifies repeated phrases at different lengths and removes documents with excessive repetition that might indicate low-quality or artificially generated content.\nFor heuristic filtering, the best practice is to implement a cascading approach. This enables more nuanced quality control while maintaining transparency in the filtering process.  For improved performance, batch filtering can be implemented to process multiple documents simultaneously, significantly reducing computation time when dealing with large-scale datasets.\nDeduplication\nDeduplication is essential for improving model training efficiency, reducing computational costs, and ensuring data diversity. It helps prevent models from overfitting to repeated content and improves generalization. The process can be implemented through three main approaches: exact, fuzzy, and semantic deduplication. These form a comprehensive strategy for handling different types of duplicates in large-scale datasets, from identical copies to conceptually similar content.\nExact deduplication\nExact deduplication focuses on identifying and removing completely identical documents. This method generates hash signatures for each document and groups documents by their hashes into buckets, keeping only one document per bucket. While this method is computationally efficient, fast and reliable, it’s limited to detecting perfectly matching content and may miss semantically equivalent documents with minor variations.\nFuzzy deduplication\nFuzzy deduplication addresses near-duplicate content using MinHash signatures and Locality-Sensitive Hashing (LSH) to identify similar documents.\nThe process involves the following steps:\nCompute MinHash signatures for documents.\nUse LSH to group similar documents into buckets. One document might belong to one or more buckets.\nCompute Jaccard similarity between documents within the same buckets.\nBased on the Jaccard similarity, transform the similarity matrix to a graph and identify connected components in the graph.\nDocuments within a connected component are considered fuzzy duplicates.\nRemove identified duplicates from the dataset.\nThis method is particularly valuable for identifying content with minor modifications, detecting partial document overlaps, and finding documents with different formatting but similar content.  It strikes a balance between computational efficiency and duplicate detection capability.\nSemantic deduplication\nSemantic deduplication represents the most sophisticated approach, employing advanced embedding models to capture semantic meaning combined with clustering techniques to group semantically similar content. Research has shown that semantic deduplication can effectively reduce dataset size while maintaining or improving model performance. It’s especially valuable for identifying paraphrased content, translated versions of the same material, and conceptually identical information.\nSemantic deduplication consists of the following steps:\nEach data point is embedded using a pretrained model.\nThe embeddings are clustered into k clusters using k-means clustering.\nWithin each cluster, pairwise cosine similarities are computed.\nData pairs with cosine similarity above a threshold are considered semantic duplicates.\nFrom each group of semantic duplicates within a cluster, one representative datapoint is kept and the rest are removed.\nModel-based quality filtering\nModel-based quality filtering employs various types of models to evaluate and filter content based on quality metrics. The choice of model type significantly impacts both the effectiveness of filtering and the computational resources required, making it crucial to select the appropriate model for specific use cases.\nDifferent types of models that can be used for quality filtering include:\nN-gram based classifiers:\nThe simplest approach uses n-gram based bag-of-words classifiers like fastText, which excel in efficiency and practicality, as they require minimal training data (100,000 to 1,000,000 samples).\nBERT-style classifiers:\nBERT-style classifiers represent a middle-ground approach, offering better quality assessment through Transformer-based architectures. They can capture more complex linguistic patterns and contextual relationships, making them effective for quality assessment.\nLLMs:\nLLMs provide the most sophisticated quality assessment capabilities, leveraging their extensive knowledge to evaluate text quality. While they offer superior understanding of content quality, they have significant computational requirements thus they are best suited for smaller-scale applications, such as fine-tuning datasets.\nReward models:\nReward models represent a specialized category designed specifically for evaluating conversational data quality. These models can assess multiple quality dimensions simultaneously but similar to LLMs, they have significant computational requirements.\nThe optimal selection of quality filtering models should consider both the dataset scale and available computational resources. For large-scale pretraining datasets, combining lightweight models for initial filtering with advanced models for final quality assessment often provides the best balance of efficiency and effectiveness. For smaller, specialized datasets where quality is crucial, using models like LLMs or reward models becomes more feasible and beneficial.\nPII redaction\nPersonally Identifiable Information (PII) redaction involves identifying and removing sensitive information from datasets to protect individual privacy and ensure compliance with data protection regulations.\nThis process is particularly important when dealing with datasets that contain personal information, from direct identifiers like names and social security numbers to indirect identifiers that could be used to identify individuals when combined with other data.\nModern PII redaction employs various techniques to protect sensitive information, including:\nReplacing sensitive information with symbols (for example, XXX-XX-1234 for U.S. Social Security Numbers) while maintaining data format and structure.\nSubstituting sensitive data with non-sensitive equivalents that maintain referential integrity for analysis purposes.\nEliminating sensitive information when its presence is not necessary for downstream tasks.\nOverall, PII redaction helps maintain data privacy, comply with regulations, and build trust with users while preserving the utility of their datasets for training and analysis purposes.\nDistributed data classification\nData classification plays a vital role in data curation. This process helps organize and categorize data based on various attributes such as domain and quality, ensuring data is well-balanced and representative of different knowledge domains.\nDomain classification helps LLMs understand the context and specific domain of input text by identifying and categorizing content based on subject matter. The domain information serves as valuable auxiliary data, enabling developers to build more diverse training datasets while identifying and filtering out potentially harmful or unwanted content. For example, using the AEGIS Safety Model, which classifies content into 13 critical risk categories, developers can effectively identify and filter harmful content from training data.\nWhen dealing with pretraining corpora that often contain billions of documents, running inference for classification becomes computationally intensive and time-consuming. Therefore, distributed data classification is necessary to overcome these challenges. This is achieved by chunking the datasets across multiple GPU nodes to accelerate the classification task in a distributed manner.\nTask decontamination\nAfter training, LLMs are usually evaluated by their performance on downstream tasks consisting of unseen test data. Downstream task decontamination is a step that addresses the potential leakage of test data into training datasets, which can provide misleading evaluation results. The decontamination process typically involves several key steps:\nIdentifying potential downstream tasks and their test sets.\nConverting test data into n-gram representations.\nSearching for matching n-grams in the training corpus.\nRemoving or modifying contaminated sections while preserving document coherence.\nThis systematic approach helps ensure the effectiveness of decontamination while minimizing unintended impacts on data quality, ultimately contributing to more reliable model evaluation and development.\nBlending and shuffling\nData blending and shuffling represent the final steps in the data curation pipeline, combining multiple curated datasets while ensuring proper randomization for optimal model training. This process is essential for creating diverse, well-balanced training datasets that enable better model generalization and performance. Data blending involves merging data from multiple sources into a unified dataset, creating more comprehensive and diverse training data. The blending process is implemented using two approaches:\nOnline: Data combination occurs during training\nOffline: Datasets are combined before training\nEach approach offers distinct advantages depending on the specific requirements of the training process and the intended use of the final dataset.\nSynthetic data generation\nHaving navigated the intricacies of the preprocessing stage, we now confront a formidable challenge in the realm of LLM development: the scarcity of data. The insatiable appetite of LLMs for vast training datasets, even for fine-tuning purposes, frequently outstrips the availability of domain-specific or language-particular data. To this end,\nsynthetic data generation (SDG)\nis a powerful approach that leverages LLMs to create artificial datasets that mimic real-world data characteristics while maintaining privacy and ensuring data utility. This process uses external LLM services to generate high-quality, diverse, and contextually relevant data that can be used for pretraining, fine-tuning, or evaluating other models.\nSDG empowers LLMs by enabling adaptation to low-resource languages, supporting domain specialization, and facilitating knowledge distillation across models, making it a versatile tool for expanding model capabilities. SDG has become particularly valuable in scenarios where real data is scarce, sensitive, or difficult to obtain.\nFigure 2. General synthetic data generation architecture with NeMo Curator\nThe synthetic data pipeline encompasses three key stages: Generate, Critique, and Filter.\nGenerate:\nUse prompt engineering to generate synthetic data for various tasks. Taking\nNemotron-4\nas an example, SDG is applied to generate training data for five different types of tasks: open-ended QA, closed-ended QA, writing assignments, coding, and math problems.\nCritique:\nUse methods like LLM reflection, LLM-as-judge, reward model inference, and other agents to evaluate the quality of synthetic data. The evaluation results can be used as feedback to SDG LLM to generate better results or filter out low quality data. A prime example is the\nNemotron-4-340B reward NIM\n, which assesses data quality through five key attributes: Helpfulness, Correctness, Coherence, Complexity, and Verbosity. By setting appropriate thresholds for these attribute scores, the filtering process ensures that only high-quality synthetic data is retained, while filtering out low-quality or inappropriate content.\nFilter:\nSteps like deduplication and PII redaction to further improve SDG data quality.\nNote, however, SDG is not suitable in all cases. Hallucinations from external LLMs can introduce unreliable information, compromising data integrity. Additionally, the generated data’s distribution may not align with the target distribution, potentially leading to poor real-world performance. In such cases, using SDG could actually harm the system’s effectiveness rather than improve it.\nData processing for building sovereign LLMs\nAs noted previously, open-source LLMs excel in English but struggle with other languages, especially those of Southeast Asia. This is primarily due to a lack of training data in these languages, limited understanding of local cultures, and insufficient tokens to capture unique linguistic structures and expressions.\nTo fully meet customer needs, enterprises in non-English-speaking countries must go beyond generic models and customize them to capture the nuances of their local languages, ensuring a seamless and impactful customer experience. For example, using NeMo Curator, Viettel Solutions processed\nhigh-quality Vietnamese data\nto increase accuracy by 10%, reduce the dataset size by 60% and accelerate training time by 3x.\nThe main steps for this use case are:\nDownload several Vietnamese and multilingual datasets (Wikipedia, Vietnamese news corpus,\nOSCAR\n, and C4) and convert to Parquet for efficient handling and processing of large datasets.\nCombine, standardize, and shard into a single dataset\nApply unicode reformatting, exact deduplication, quality filtering (heuristic and classifier-based).\nYou can\nfollow along with the full tutorial\n.\nImprove data quality with NVIDIA NeMo Curator\nSo far, we have discussed the importance of data quality in improving the accuracy of LLMs and explored various data processing techniques. Developers can now try these techniques directly through\nNeMo Curator\n. It provides a customizable and modular interface that enables developers to build on top of it easily.\nNeMo Curator uses NVIDIA RAPIDS GPU-accelerated libraries like cuDF, cuML, and cuGraph, and Dask to speed up workloads on multinode multi-GPUs, reducing processing time and scale as needed. For example, by using GPUs to accelerate the data processing pipelines,\nZyphra reduced the total cost of ownership (TCO)\nby 50% and processed the data 10x faster (from 3 weeks to 2 days).\nTo get started, check out the\nNVIDIA\/NeMo-Curator GitHub repository\nand available\ntutorials\nthat cover various data curation workflows, such as:\nData processing for pretraining\nData processing for customization\nSDG pipelines\nYou can also gain access through a\nNeMo framework container\nand request enterprise support with an\nNVIDIA AI Enterprise\nlicense.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/mastering-llm-techniques-data-preprocessing\/","jp_title":"LLM テクニックの習得: データの前処理","jp_content":"Reading Time:\n2\nminutes\n大規模言語モデル (LLM)\nの出現は、企業が AI を活用して業務とサービスを強化する方法に大きな変化をもたらしました。LLM は日常的な作業を自動化し、プロセスを合理化することで、人的リソースをより戦略的な取り組みに割り当てることで、全体的な効率性と生産性を向上させます。\nLLM を高精度にトレーニングおよび\nカスタマイズ\nするには、高品質なデータが必要となるため、多くの課題を伴います。データの質が低く、量が十分でないと、モデルの精度が大幅に低下する可能性があるため、AI 開発者にとってデータセットの準備は重要な作業の 1 つとなっています。\nデータセットには往々にして重複したドキュメント、個人を特定できる情報 (PII)、フォーマットに関する問題が存在します。データセットの中には、ユーザーにリスクをもたらす有害な情報や不適切な情報が含まれているものさえあります。適切な処理を行わずにこういったデータセットでモデルをトレーニングすると、トレーニング時間が長引いたり、モデルの品質が低下する場合があります。もう 1 つの大きな課題はデータの不足です。モデル開発者はトレーニング用の公開データを使い果たしつつあり、多くの人々がサードパーティのベンダーに依頼したり、高度な LLM を使用して合成データを生成したりするようになっています。\nこの記事では、トレーニング用のデータの品質を向上することで LLM のパフォーマンスを最適化するためのデータ処理テクニックとベスト プラクティスについて説明します。また、\nNVIDIA NeMo Curator\nの概要および前述した課題への対処方法を説明し、LLM の実際のデータ処理のユース ケースもご紹介します。\nテキスト処理パイプラインとベスト プラクティス\n大規模データの前処理は容易ではありません。特に、データセットが主にWeb スクレイピングされたデータで構成されており、大量の不適切なフォーマットの低品質データが含まれている可能性が高い場合はなおさらです。\n図 1. NeMo Curator を使用して構築できるテキスト処理パイプライン\n図 1 は、以下の手順を含む包括的なテキスト処理パイプラインの概要を示しています。\nソースからデータセットをダウンロードし、JSONL などの望ましいフォーマットで抽出します。\nUnicode の修正や言語による分類など、予備的なテキスト クリーニングを適用します。\n特定の品質基準に基づいて、標準的なフィルターとカスタム定義のフィルターの両方をデータセットに適用します。\nさまざまなレベルの重複排除 (厳密、曖昧、意味的) を実行します。\nモデルベースの品質フィルタリング、個人情報 (PII) の削除、(分散処理による) データ分類、下流タスクの汚染除去などの高度な品質フィルタリングを必要に応じて選択的に適用します。\n複数のソースから収集され、精選されたデータセットを一体化し、統合したデータセットを作成します。\n以下のセクションでは、これらの各段階について詳しく説明します。\nテキストをダウンロードして抽出\nデータ キュレーションの最初のステップでは、 Common Crawl のような、さまざまな一般的なソース、arXiv や PubMed などの専門的なコレクション、自社保有のプライベート データなどからデータセットをダウンロードして準備します。これらのデータセットには、それぞれテラバイト単位のデータが含まれている可能性があります。\nこの重要なフェーズでは、保存形式と抽出方法を慎重に検討する必要があります。一般に公開されホストされているデータセットは圧縮形式 (例: .warc.gz、tar.gz、zip ファイル) で提供されることが多いため、後続の処理のためにより扱いやすい形式 (.jsonl や .parquet など) に変換する必要があります。\n予備的なテキスト クリーニング\nUnicode の修正と言語による分類は、特に大規模な Web スクレイピングによるテキスト コーパスを扱う場合、データ キュレーション パイプラインの重要な初期ステップです。このフェーズでは、不適切にデコードされた Unicode 文字と、データセット内に複数の言語が存在するという 2 つの基本的な課題に対処します。\nUnicode 形式に関する問題は、多くの場合、文字エンコードの誤りや、エンコード\/デコード サイクルが複数回実行されることによって発生します。よくある問題としては、特殊文字が文字化けした文字列 (例:「café」が「café」と表示される) として表示されることが挙げられます。言語の識別と分類は、特に単一言語のデータセットのキュレーションに関心のある開発者にとっては同様に重要です。さらに、ヒューリスティック フィルタリング、モデルベースの品質分類器などのデータ キュレーションのステップの一部は言語に依存しています。\nこの予備的な前処理ステップでは、識別された言語で適切にエンコードされたクリーンなテキストが確保され、その後のキュレーションステップの基盤となります。\nヒューリスティック フィルタリング\nヒューリスティック フィルタリングでは、ルールベースの評価指標と統計的尺度を使用して、低品質なコンテンツを特定し、削除します。\nこのプロセスは通常、ドキュメントの長さ、繰り返しパターン、句読点の分布、テキストの構造的整合性など、複数の品質基準で評価されます。一般的なヒューリスティック フィルターには以下のようなものがあります。\n単語数フィルター:\n意味をなさないほど短すぎる、または疑わしいほどに長すぎるテキストをフィルタリングします。\n定型文フィルター:\n過剰な定型文を含むテキストを特定し、削除します。\nN-gram 反復フィルター:\n異なる長さで繰り返されるフレーズを特定し、低品質または人工的に生成されたコンテンツである可能性がある過剰な反復を含む文書を削除します。\nヒューリスティック フィルタリングの場合は、カスケード アプローチを採るのが最善の方法です。これにより、フィルタリング プロセスの透明性を維持しながら、より繊細な品質管理が可能になります。処理パフォーマ��スを向上させるために、バッチ フィルタリングを採用して複数のドキュメントを同時に処理すると大規模なデータセットを扱う際の計算時間を大幅に短縮することができます。\n重複排除\n重複排除は、モデルのトレーニング効率の向上、計算コストの削減、データの多様性の確保に不可欠です。繰り返し出現するコンテンツにモデルが過剰適合するのを防ぎ、汎用性を高めます。このプロセスは、厳密、曖昧、意味という 3 つの主な重複排除アプローチを通じて実装できます。これらは、同一のコピーから概念的に類似したコンテンツまで、大規模データセット内の異なるタイプの重複を処理する包括的な戦略を形成します。\n厳密な重複排除\n厳密な重複排除は、完全に同一のドキュメントを識別し、削除することに重点を置いています。この方法では、ドキュメントごとにハッシュ署名を生成し、ハッシュごとにドキュメントをグループ化してバケットに格納し、バケットごとに 1 つのドキュメントのみを残します。この方法は計算効率が高く、高速かつ信頼性が高いのですが、完全に一致するコンテンツの検出に限定されるため、意味的には同等なのにわずかに異なる文書を見逃す可能性があります。\n曖昧な重複排除\n曖昧な重複排除は、MinHash 署名と局所性鋭敏型ハッシュ化 (LSH: Locality-Sensitive Hashing) を使用して、類似したドキュメントを識別し、ほぼ重複するコンテンツに対処します。\nこのプロセスには、以下のステップが含まれます。\nドキュメントの MinHash 署名を計算します。\nLSH を使用して、類似したドキュメントをバケットにグループ化します。1 つのドキュメントが 1 つ以上のバケットに属する場合もあります。\n同じバケット内のドキュメント間で Jaccard 類似度を計算します。\nJaccard 類似度に基づいて、類似度行列をグラフに変換し、グラフ内の連結成分を特定します。\n連結成分内のドキュメントは曖昧な重複と見なされます。\n特定した重複をデータセットから削除します。\nこの方法は、軽微な変更が加えられたコンテンツの特定、部分的なドキュメントの重複の検出、異なるフォーマットであるが類似したコンテンツを持つドキュメントの検索に特に有用です。計算効率と重複検出能力のバランスが取れています。\n意味的な重複排除\n意味的な重複排除は、最も洗練されたアプローチであり、高度な埋め込みモデルを使用してセマンティックな意味を捉え、クラスタリング技術と組み合わせて意味的に類似したコンテンツをグループ化します。研究では、意味的な重複排除は、モデルのパフォーマンスを維持または改善しながら、データセットのサイズを効果的に縮小できることが示されています。言い換えられたコンテンツ、同じ素材の翻訳版、概念的に同一の情報を特定するのに特に有用です。\n意味による重複排除は、以下のステップで構成されます。\n各データ ポイントが、事前学習済みモデルを使用して埋め込まれます。\n埋め込みは、k-means を使用して k 個のクラスターにグループ化されます。\n各クラスター内で、ペアごとのコサイン類似度が計算されます。\n閾値を超えるコサイン類似度を有するデータ ペアは、意味の重複と見なされます。\nクラスター内の意味的な重複の各グループから、1 つの代表的なデータポイントが保持され、残りは削除されます。\nモデルベースの品質フィルタリング\nモデルベースの品質フィルタリングでは、さまざまな種類のモデルを使用して、品質指標に基づいてコンテンツを評価してフィルタリングします。モデルの種類の選択は、フィルタリングの有効性と必要な計算リソースの両方に大きな影響を及ぼすため、特定のユース ケースに適切なモデルを選択することが重要です。\n品質フィルタリングに使用できるモデルには、以下の種類があります。\nN-gram ベースの分類器:\n最も単純なアプローチは、fastText のような N-gram ベースの Bag-of-Words 分類器を使用する方法です。必要なトレーニング データ (10 万~100 万サンプル) が最も少なく済むため、効率性と実用性に優れています。\nBERT スタイルの分類器:\nBERT スタイルの分類器は中間的なアプローチであり、Transformer ベースのアーキテクチャを通じてより質の��い評価を提供します。より複雑な言語パターンや文脈上の関係を捉えることができ、品質評価に効果的です。\nLLM:\nLLM は、テキストの品質評価に幅広い知識を活用し、最も洗練された品質評価機能を提供します。コンテンツの品質をより深く理解できますが、計算要件も高いため、ファインチューニング用のデータセットなど、小規模なアプリケーションに向いています。\n報酬モデル:\n報酬モデルは、会話データの品質を評価に特化し設計された専門カテゴリです。これらのモデルは複数の品質基準を同時に評価できますが、LLM と同じく高い計算要件が求められます。\n最適な品質フィルタリング モデルの選択には、データセットの規模と利用可能な計算リソースの両方を考慮する必要があります。大規模な事前学習データセットの場合、初期フィルタリングには軽量なモデルを使用し、最終的な品質評価には高度なモデルを組み合わせることで、効率性と有効性のバランスが得られます。品質が重要となる小規模で専門的なデータセットの場合は、LLM や報酬モデルなどのモデルを使用することが、より実現的で有益となります。\nPII の削除\n個人を特定できる情報 (PII) の削除には、個人のプライバシーを保護し、データ保護規制に対する遵守を確実にするために、データセット内の機密情報を識別および削除することが含まれます。\nこのプロセスは、氏名や社会保障番号などの直接的な識別子から、他のデータと組み合わせることで個人を識別できる間接的な識別子まで、個人情報を含むデータセットを扱う場合には特に重要です。\n最新の PII 削除では、機密情報を保護するために、以下を含むさまざまな技術が用いられています。\nデータ形式と構造を維持しながら、機密情報を記号に置き換える (たとえば、米国社会保障番号の場合 XXX-XX-1234 に置き換える)。\n分析の目的で参照整合性を維持しながら、機密データを機密でない同等のデータに置き換える。\n下流タスクに必要でない場合、その機密情報を削除する。\n全体として PII の削除は、データのプライバシーを保護し、規制を遵守し、トレーニングと分析の目的でデータセットの有用性を維持しながら、ユーザーと信頼関係を構築するのに役立ちます。\n(分散処理による) データ分類\nデータ分類は、データ キュレーションにおいて重要な役割を果たします。このプロセスでは、ドメインや品質など多様な属性に基づいてデータを整理し、分類することでデータのバランスを取り、さまざまな知識ドメインを代表するものとなるようにします。\nドメイン分類は、主題に基づいてコンテンツを識別してカテゴリー分けすることで、LLM が入力テキストのコンテキストや特定のドメインを理解するのに役立ちます。ドメイン情報は、開発者が潜在的に有害または不要なコンテンツを特定し、フィルタリングしながら、より多様なトレーニング データセットを構築することを可能にする貴重な補助的情報となります。たとえば、コンテンツを 13 の重大なリスク カテゴリに分類する AEGIS Safety Model を使用することで、開発者はトレーニング データから有害なコンテンツを効果的に識別し、フィルタリングすることができます。\n数十億ものドキュメントが含まれていることが多い事前学習コーパスを扱う場合、分類を行うための推論を実行するのに多くの計算処理と時間が必要となります。したがって、これらの課題を克服するには、分散処理が適用できるデータ分類が必要です。これは、データセットを複数の GPU ノードに分割することで、分類タスクを高速化することによって実現されます。\n下流タスクの汚染除去\nトレーニングの後、LLM は通常、見えないテスト データで構成される下流タスクのパフォーマンスによって評価されます。下流タスクの汚染除去は、テスト データがトレーニング データセットに混入、漏洩する可能性に対処するステップです。これは意図しない評価結果をもたらすリスクを抑えます。汚染除去プロセスには、通常、以下の主要なステップが含まれます。\n潜在的な下流タスクとそのテスト セットを特定します。\nテスト データを N-gram 表現に変換します。\nトレーニング コーパスで一致する N-gram ���検索します。\nドキュメントの整合性を維持しながら、汚染されたセクションを削除または修正します。\nこの体系的なアプローチは、データの品質に対する意図しない影響を最小限に抑えながら、汚染除去の効果を確実なものにして、最終的には、より信頼性の高いモデルの評価と開発に貢献します。\nブレンドとシャッフル\nデータのブレンドとシャッフルは、データ キュレーション パイプラインにおける最終ステップであり、複数のキュレーションされたデータセットを組み合わせると同時に適切なランダム性を確保し、最適なモデル トレーニングを実現します。このプロセスは、モデルの一般化とパフォーマンスを向上させる、多様でバランスの取れたトレーニング データセットを作成する上で不可欠です。データのブレンドでは、複数のソースからのデータを統合して単一のデータセットに結合し、より包括的で多様なトレーニング データを作成します。ブレンド プロセスは、次の 2 つのアプローチを使用して実装されます。\nオンライン: トレーニング中にデータが結合される\nオフライン: トレーニング前にデータセットが結合される\nそれぞれのアプローチには、トレーニング プロセスの特定の要件と最終的なデータセットの使用目的に応じて異なる利点があります。\n合成データの生成\n前処理フェーズの複雑なプロセスを終えましたが、現在、LLM 開発の分野ではデータの不足という大きな課題に直面しています。LLM が学習用データセットを大量に必要とするのは、チューニングを目的とする場合でも同様であり、その飽くなき要求は、特定のドメインや言語に特化したデータの入手可能性を上回ることも少なくありません。この問題に対処する\n合成データ生成 (SDG: Synthetic Data Generation)\nは、LLM を活用して、プライバシーの保護とデータの有用性を確保しながら、現実のデータ特性を模倣した人工的なデータセットを生成する強力なアプローチです。このプロセスでは外部 LLM サービスを使用して、事前学習、ファインチューニング、他のモデルの評価に使用できる、高品質で多様かつ文脈的に関連性の高いデータを生成します。\nSDG は、低リソース言語に LLM が適応できるようにすることで、ドメインの専門性をサポートし、モデル間の知識の抽出を促進し、モデル機能を拡張する汎用的なツールになります。SDG は、特に実データが不足していたり、機密であったり、取得するのが困難だったりするシナリオにおいて、重要な存在となっています。\n図 2. NeMo Curator による一般的な合成データ生成アーキテクチャ\n合成データ パイプラインには、生成、批評、フィルターの 3 つの主要なステップがあります。\n生成:\nプロンプト エンジニアリングを使用して、さまざまなタスク用の合成データを生成します。\nNemotron-4\nを例にとると、SDG は、5 種類の異なるタスク (自由形式 QA、選択式 QA、記述式課題、コーディング、数学問題) のトレーニング データを生成するために適用されます。\n批評:\nLLM Reflection、LLM-as-judge、報酬モデル推論、その他のエージェントなどの手法を使用して、合成データの品質を評価します。評価結果は SDG LLM へのフィードバックとして使用し、より良い結果を生成したり、低品質データをフィルタリングしたりすることができます。代表的な例は\nNemotron-4-340B reward NIM\nです。これは、5 つの主要な属性、すなわち Helpfulness (有用性)、Correctness (正確性)、Coherence (一貫性)、Complexity (複雑性)、Verbosity (冗長性) を通じてデータの品質を評価します。これらの属性スコアに適切な閾値を設定することで、フィルタリング処理では、低品質または不適切なコンテンツを除外しながら、高品質な合成データのみが保持されるようになります。\nフィルター:\n重複排除や PII の削除などのステップで、SDG データの品質をさらに向上させます。\nただし、SDG がすべてのケースに適しているわけではないことに注意してください。外部 LLM による幻覚は、信頼性の低い情報をもたらし、データの整合性を損なう可能性があります。加えて、生成されたデータの分布がターゲットの分布と一致しない可能性があり、現実世界のパフォーマンスに悪影響を及ぼす可能性があります。そのような場合は、SDG を使用することで、システムの効率性を改善するどころか、むしろ低下させる可能性があります。\nソブリン AI LLM 構築のためのデータ処理\nオープンソース LLM は英語では優れていますが、その他の言語、特に東南アジアの言語では苦戦しています。この主な原因は、これらの言語のトレーニング データの不足、現地の文化に対する理解が限られていること、独自の言語構造と表現を捉えるのに十分なトークンが不足していることです。\n英語圏以外の国々の企業は、顧客のニーズを完全に満たすため、汎用モデルにとどまらず、現地の言語のニュアンスを捉えるためにモデルをカスタマイズし、シームレスでインパクトのある顧客体験を確保する必要があります。例えば、Viettel Solutions は、NeMo Curator を使用して、\n高品質なベトナム語データ\nを処理し、精度を 10% 向上させ、データセットのサイズを 60% 削減し、トレーニングを 3 倍高速化しました。\nこのユース ケースの主な手順は次のとおりです。\nいくつかのベトナム語および多言語データセット (Wikipedia、ベトナム語ニュース コーパス、\nOSCAR\n、C4) をダウンロードし、大規模なデータセットを効率的に処理するために、Parquet に変換します。\n複数のデータセットを結合、標準化し、単一のデータセットにシャードします。\nUnicode の再フォーマット、厳密な重複排除、品質フィルタリング (ヒューリスティックおよび分類器ベース) を適用します。\n詳細は、この\nチュートリアル\nを参照してください。\nNVIDIA NeMo Curator によるデータの品質向上\nここまで、LLM の精度向上におけるデータ品質の重要性について、そしてさまざまなデータ処理手法について説明してきました。開発者は、\nNeMo Curator\nを介して直接これらの手法を試すことができます。NeMo Curator は、カスタマイズ可能なモジュール式のインターフェイスを提供しているため、開発者はそれをベースに簡単に構築することができます。\nNeMo Curator は、cuDF、cuML、cuGraph、Dask などの NVIDIA RAPIDS GPU で高速化されたライブラリを使用して、マルチノード、マルチ GPU におけるワークロードを高速化し、必要に応じてスケールさせ、処理時間を削減できます。例えば、GPU を使用してデータ処理のパイプラインを高速化することで、\nZyphra は総所有コスト (TCO)\nを 50% 削減し、データを 10 倍高速に処理しています (3 週間から 2 日間)。\nまずは、\nNVIDIA\/NeMo-Curator GitHub リポジトリ\nと、以下のさまざまなデータ キュレーションのワークフローを網羅している\nチュートリアル\nをご覧ください。\n事前学習のためのデータ処理\nカスタマイズのためのデータ処理\nSDG パイプライン\nまた、\nNeMo フレームワーク コンテナー\nを介してアクセスし、\nNVIDIA AI Enterprise\nライセンスでエンタープライズ サポートをリクエストすることもできます。\n関連情報\nGTC セッション:\nセキュアなエンタープライズ データでカスタム LLM アプリを数分で構築する\nGTC セッション:\nLLM インフラの構築、トレーニング速度の高速化、生成 AI イノベーションの推進のためのエンドツーエンドのソリューションの設計 (Aivres 提供)\nNGC コンテナー:\ngenai-llm-playground\nNGC コンテナー:\nrag-application-query-decomposition-agent\nウェビナー:\nAI による医療ワークフローの変革: CLLM を深く掘り下げる"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/expanding-ai-agent-interface-options-with-2d-and-3d-digital-human-avatars\/","en_title":"Expanding AI Agent Interface Options with 2D and 3D Digital Human Avatars","en_content":"When interfacing with\ngenerative AI\napplications, users have multiple communication options—text, voice, or through digital avatars.\nTraditional chatbot or copilot applications have text interfaces where users type in queries and receive text-based responses. For hands-free communication, speech AI technologies like\nautomatic speech recognition\n(ASR) and\ntext-to-speech\n(TTS) facilitate verbal interactions, ideal for scenarios like phone-based customer service. Moreover, combining digital avatars with speech capabilities provides a more dynamic interface for users to engage visually with the application. According to Gartner, by 2028, 45% of organizations with more than 500 employees will leverage employee AI avatars to expand the capacity of human capital.\n1\nDigital avatars can vary widely in style—some use cases benefit from photorealistic 3D or 2D avatars, while other use cases work better with a stylized, or cartoonish avatar.\n3D Avatars\noffer fully immersive experiences, showcasing lifelike movements and photorealism. Developing these avatars requires specialized software and technical expertise, as they involve intricate body animations and high-quality renderings.\n2D Avatars\nare quicker to develop and ideal for web-embedded solutions. They offer a streamlined approach to creating interactive AI, often requiring artists for design and animation but less intensive in terms of technical resources.\nTo kickstart your creation of a photo-realistic digital human, the\nNVIDIA AI Blueprint on digital humans for customer service\ncan be tailored for various use cases. This functionality is now included with support for the NVIDIA Maxine\nAudio2Face-2D\nNIM microservice. ‌Additionally, the blueprint now offers flexibility in rendering for 3D avatar developers to use\nUnreal Engine\n.\nHow to add a talking digital avatar to your agent application\nIn the AI Blueprint for digital humans, a user interacts with an\nAI agent\nthat leverages\nNVIDIA ACE\ntechnology (Figure 1).\nFigure 1. Architecture diagram for the NVIDIA AI Blueprint for digital humans\nThe audio input from the user is sent to the ACE agent which orchestrates the communication between various NIM microservices. The ACE agent uses the\nRiva Parakeet NIM\nto convert the audio to text, which is then processed by a RAG pipeline. The RAG pipeline uses the NVIDIA NeMo Retriever\nembedding\nand\nreranking\nNIM microservices, and an\nLLM NIM\n, to respond with relevant context from stored documents.\nFinally, the response is converted back to speech via Riva TTS, animating the digital human using the Audio2Face-3D NIM or Audio2Face-2D NIM.\nConsiderations when designing your AI agent application\nIn global enterprises, communication barriers across languages can slow down operations. AI-powered avatars with multilingual capabilities communicate across languages effortlessly. The digital human AI Blueprint provides conversational AI capabilities that simulate human interactions that accommodate users’ speech styles and languages through Riva ASR, neural machine translation (NMT) along with intelligent interruption and barge-in support.\nOne of the key benefits of digital human AI agents is their ability to function as “always-on” resources for employees and customers alike. RAG-powered AI agents continuously learn from interactions and improve over time, providing more accurate responses and better user experiences.\nFor enterprises considering digital human interfaces, choosing the right avatar and rendering option depends on the use case and customization preferences.\nUse Case\n: 3D avatars are ideal for highly immersive use cases like in physical stores, kiosks or primarily one-to-one interactions, while 2D avatars are effective for web or mobile conversational AI use cases.\nDevelopment and Customization Preferences\n: Teams with 3D and animation expertise can leverage their skillset to create an immersive and ultra-realistic avatar, while teams looking to iterate and customize quickly can benefit from the simplicity of 2D avatars.\nScaling Considerations:\nScaling is an important consideration when evaluating avatars and corresponding rendering options. Stream throughput, especially for 3D avatars, is highly dependent on the choice and quality of the character asset used, the desired output resolution and the rendering option of choice (Omniverse Renderer or Unreal Engine) can play a critical role in determining per stream compute footprint.\nNVIDIA Audio2Face-2D allows creation of lifelike 2D avatars from just a portrait image and voice input. Easy and simple configurations allow developers to quickly iterate and produce target avatars and animations for their digital human use cases. With real-time output and cloud-native deployment, 2D digital humans are ideal for interactive use cases and streaming avatars for interactive web-embedded solutions.\nFor example, enterprises looking to deploy AI agents across multiple devices and inserting digital humans into web- or mobile-first customer journeys, can benefit from the reduced hardware demands of 2D avatars.\n3D photorealistic avatars provide an unmatched immersive experience for use cases demanding ‌highly empathetic user engagement. NVIDIA Audio2Face-3D and Animation NIM microservices animate a 3D character by generating blendshapes along with subtle head and body animation to create an immersive, photorealistic avatar. The digital human AI Blueprint now supports two rendering options for 3D avatars, including Omniverse Renderer and Unreal Engine Renderer, providing developers the flexibility to integrate the rendering option of their choice.\nTo explore how digital humans can enhance your enterprise, visit the\nNVIDIA API catalog\nto learn about the different avatar options.\nGetting started with digital avatars\nFor hands-on development with Audio2Face-2D and Unreal Engine NIM microservices,\napply for ACE Early Access\nor dive into the digital human AI Blueprint\ntechnical blog\nto learn how you can add digital human interfaces to personalize chatbot applications.\n1\nGartner®, Hype Cycle for the Future of Work, 2024 by Tori Paulman, Emily Rose McRae, etc., July 2024\nGARTNER is a registered trademark and service mark of Gartner, Inc. and\/or its affiliates in the U.S. and internationally and is used herein with permission. All rights reserved.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/expanding-ai-agent-interface-options-with-2d-and-3d-digital-human-avatars\/","jp_title":"2D と 3D のデジタル ヒューマン アバターによる AI エージェント インターフェイス オプションの拡張","jp_content":"Reading Time:\n2\nminutes\nユーザーが\n生成 AI\nアプリケーションを使ってやり取りする際には、テキスト、音声、デジタル アバターなど複数のコミュニケーション オプションを利用することができます。\n従来のチャットボットやコパイロット アプリケーションでは、ユーザーが問い合わせを入力し、テキストベースの応答を受信するテキスト インターフェイスを使用しています。ハンズフリーのコミュニケーションでは、\n自動音声認識\n(ASR: Automatic Speech Recognition) や\n音声合成\n(TTS: Text-To-Speech) などの音声 AI 技術により、電話を使用したカスタマー サービスなどのシナリオに最適な口頭によるやり取りが容易になります。さらに、デジタル アバターに音声機能を持たせることで、ユーザーがアプリケーションを視覚的に使用できるため、ダイナミックなインターフェイスを提供できます。Gartner によると、2028 年までに、従業員 500 名以上の組織の 45% が、人的資本の能力拡大のために、 AI アバターの従業員を活用するようになるそうです。\n1\nデジタル アバターのスタイルは様々で、フォトリアリスティックな 3D または 2D のアバターが適しているケースもあれば、定型化されたアバターや漫画のようなアバターの方が適しているケースもあります。\n3D アバター\nは、リアルな動きと写実性を再現し、完全な没入体験を提供します。このようなアバターの開発には、複雑なボディー アニメーションや高品質のレンダリングが必要となるため、専門的なソフトウェアや技術的な専門知識が必要になります。\n2D アバター\nは開発が迅速で、Web に組み込みソリューションに最適です。インタラクティブな AI の作成に合理的なアプローチを提供し、デザインやアニメーションにはアーティストが必要になることが多いですが、技術的なリソースの面はそれほど負担になりません。\nフォトリアリスティックなデジタル ヒューマンの作成を始めるにあたり、\nカスタマー サービス向けデジタル ヒューマンの NVIDIA AI Blueprint\nは、さまざまなユース ケースに合わせてカスタマイズすることができます。この機能は現在、NVIDIA Maxine\nAudio2Face-2D\nNIM マイクロサービスのサポートに含まれています。さらに、この Blueprint では、3D アバター開発者が\nUnreal Engine\nを使用できるよう、レンダリングに柔軟性を持たせています。\nエージェント アプリケーションに会話するデジタル アバターを追加する方法\nデジタル ヒューマン向け AI Blueprint では、ユーザーが\nNVIDIA ACE\n技術を活用した\nAI エージェント\nと対話します (図 1)。\n図 1. デジタル ヒューマン向け NVIDIA AI Blueprint のアーキテクチャ\nユーザーによる音声入力は、さまざまな NIM マイクロサービス間の通信を調整する ACE エージェントに送信されます。ACE エージェントは、\nRiva Parakeet NIM\nを使用して音声をテキストに変換し、そのテキストは RAG パイプラインで処理されます。RAG パイプラインでは、NIM マイクロサービスの\n埋め込み\nと\nリランク\nを行う NVIDIA NeMo Retriever と\nLLM NIM\nを使用して、保存されたドキュメントから関連するコンテキストを用いて応答します。\n最後に、Riva TTS を介してこの応答を音声に変換し、Audio2Face-3D NIM または Audio2Face-2D NIM を使用してデジタル ヒューマンをアニメーション化します。\nAI エージェント アプリケーションを設計する際に考慮すべきポイント\nグローバル企業では、言語の壁によるコミュニケーションの障害が業務の妨げとなることがあります。多言語機能を備えた AI 搭載アバターを使用すれば、言語の壁を超えた円滑なコミュニケーションを取ることができます。デジタル ヒューマン AI Blueprint は、Riva ASR やニューラル機械翻訳 (NMT: Neural Machine Translation) に加え、インテリジェントな割り込みやバージイン機能を備え、ユーザーの話し方や言語に柔軟に対応できる、人間らしい対話型 AI を実現します。\nデジタル ヒューマン AI エージェントの主な利点の 1 つは、従業員と顧客の両者にとって「常時稼働する」リソースとして機能できることです。RAG を搭載した AI エージェントは、やりとりから継続的に学習し、時間の経過とともに改善していくため、より正確な対応とより優れたユーザー体験を提供することができます。\nデジタル ヒューマン インターフェイスを検討している企業にとって、適切なアバターとレンダリング オプションの選択は、ユース ケースやカスタマイズ設定に依存します。\nユース ケース\n: 3D アバターは、実店舗やキオスク (無人端末) など、主に 1対 1 のやりとりのような、非常に没入感の高いユース ケースに最適ですが、2D アバターは、Web やモバイルの対話型 AI ユース ケースに効果的です。\n開発とカスタマイズの設定\n: 3D やアニメーションの専門知識を持つチームは、そのスキルを活用して没入感のある超リアルなアバターを作成できます。一方、反復作業やカスタマイズを迅速に行いたいチームには、シンプルな 2D アバターが有効です。\nスケーリングの考慮すべきポイント\n: アバターと対応するレンダリング オプションを評価する際に、スケーリングは考慮すべき重要なポイントです。ストリームのスループットは、特に 3D アバターの場合、使用するキャラクター アセットの選択と品質によって大きく異なります。希望する出力解像度や選択するレンダリング オプション (Omniverse Renderer または Unreal Engine) は、ストリームあたりの計算フットプリントを決定する上で重要な役割を果たします。\nNVIDIA Audio2Face-2D では、顔写真と音声入力だけでリアルな 2D アバターを作成できます。簡単でシンプルな構成のため、開発者はデジタル ヒューマンのユース ケースに合わせたアバターやアニメーションを迅速に繰り返し作成できます。リアルタイム出力とクラウド ネイティブのデプロイにより、2D デジタル ヒューマンは、インタラクティブなユース ケースや、インタラクティブな Web 組み込みソリューション向けのストリーミング アバターに最適です。\nたとえば、複数のデバイスに AI エージェントをデプロイし、Web またはモバイル ファーストのカスタマー ジャーニーにデジタル ヒューマンを導入しようとしている企業には、2D アバターはハードウェア要件が軽減するのでメリットがあります。\n3D のフォトリアリスティックなアバターは、高い共感が要求されるユーザー エンゲージメントを必要とするユース ケースに、比類のない没入体験を提供します。NVIDIA Audio2Face-3D とアニメーション NIM マイクロサービスは、繊細な頭部と身体のアニメーションとともにブレンドシェイプを生成し、没入感のあるフォトリアリスティックなアバターを作成することで、3D キャラクターをアニメーション化します。デジタル ヒューマン AI Blueprint は、3D アバターのレンダリング オプションをとして、Omniverse レンダラーと Unreal-Engine レンダラーをサポートしており、開発者が選択したレンダリング オプションを柔軟に統合できるようになりました。\nデジタル ヒューマンが企業を強化する方法については、\nNVIDIA API カタログ\nにアクセスして、さまざまなアバターのオプションをご覧ください。\nデジタル アバターを始める\nAudio2Face-2D と Unreal Engine NIM マイクロサービスを使用した実践的な開発については、\nACE 早期アクセスに申し込む\nか、デジタル ヒューマン AI Blueprint の\n技術ブログ\nにアクセスして、チャットボット アプリケーションをパーソナライズするためにデジタル ヒューマン インターフェイスを追加する方法について学ぶことができます。\n1\nGartner®, Hype Cycle for the Future of Work, 2024 by Tori Paulman, Emily Rose McRae, etc., July 2024\nGARTNER is a registered trademark and service mark of Gartner, Inc. and\/or its affiliates in the U.S. and internationally and is used herein with permission. All rights reserved.\n関連情報\nGTC セッション:\nEnhancing the Digital Human Experience with Cloud Microservices Accelerated by Generative AI\nGTC セッション:\nBuild a World of Interactive Avatars Based on NVIDIA Omniverse, AIGC, and LLM\nNGC コンテナー:\nACE エージェント サンプル フロントエンド\nSDK:\nNVIDIA Tokkio\nウェビナー:\nHow Telcos Transform Customer Experiences with Conversational AI"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/ai-ran-goes-live-and-unlocks-a-new-ai-opportunity-for-telcos\/","en_title":"AI-RAN Goes Live and Unlocks a New AI Opportunity for Telcos","en_content":"AI is transforming industries, enterprises, and consumer experiences in new ways. Generative AI models are moving towards reasoning,\nagentic AI\nis enabling new outcome-oriented workflows and\nphysical AI\nis enabling endpoints like cameras, robots, drones, and cars to make decisions and interact in real time.\nThe common glue between all these use cases is the need for pervasive, reliable, secure, and super-fast connectivity.\nTelecommunication networks must prepare for this new kind of AI traffic, which can come directly through the fronthaul wireless access network or backhauled from the public or private cloud as a completely standalone AI inferencing traffic generated by enterprise applications.\nLocal wireless infrastructure offers an ideal place to process AI inferencing. This is where a new approach to telco networks, AI radio access network (\nAI-RAN\n), stands out.\nTraditional CPU or ASIC-based RAN systems are designed only for RAN use and cannot process AI traffic today. AI-RAN enables a common GPU-based infrastructure that can run both wireless and AI workloads concurrently, turning networks from single-purpose to multi-purpose infrastructures and turning sites from cost-centers to revenue sources.\nWith a strategic investment in the right kind of technology, telcos can leap forward to become the AI grid that facilitates the creation, distribution, and consumption of AI across industries, consumers, and enterprises. This moment in time presents a massive opportunity for telcos to build a fabric for AI training (creation) and AI inferencing (distribution) by repurposing their central and distributed infrastructures.\nSoftBank and NVIDIA fast-forward AI-RAN commercialization\nSoftBank has turned the AI-RAN vision into reality, with its\nsuccessful outdoor field trial\nin Fujisawa City, Kanagawa, Japan, where NVIDIA-accelerated hardware and\nNVIDIA Aerial\nsoftware served as the technical foundation.\nThis achievement marks multiple steps forward for AI-RAN commercialization and provides real proof points addressing industry requirements on technology feasibility, performance, and monetization:\nWorld’s first outdoor 5G AI-RAN field trial running on an NVIDIA-accelerated computing platform. This is an end-to-end solution based on a full-stack, virtual 5G RAN software integrated with 5G core.\nCarrier-grade virtual RAN performance achieved.\nAI and RAN multi-tenancy and orchestration achieved.\nEnergy efficiency and economic benefits validated compared to existing benchmarks.\nA new solution to unlock AI marketplace integrated on an AI-RAN infrastructure.\nReal-world AI applications showcased, running on an AI-RAN network.\nAbove all, SoftBank aims to commercially release their own AI-RAN product for worldwide deployment in 2026.\nTo help other mobile network operators get started on their AI-RAN journey now, SoftBank is also planning to offer a reference kit comprising the hardware and software elements required to trial AI-RAN in a fast and easy way.\nEnd-to-end AI-RAN solution and field results\nSoftBank developed their AI-RAN solution by integrating hardware and software components from NVIDIA and ecosystem partners and hardening them to meet carrier-grade requirements. Together, the solution enables a full 5G vRAN stack that is 100% software-defined, running on NVIDIA GH200 (CPU+GPU), NVIDIA Bluefield-3 (NIC\/DPU), and Spectrum-X for fronthaul and backhaul networking. It integrates with 20 radio units and a 5G core network and connects 100 mobile UEs.\nThe core software stack includes the following components:\nSoftBank-developed and optimized 5G RAN Layer 1 functions such as channel mapping, channel estimation, modulation, and forward-error-correction, using\nNVIDIA Aerial CUDA-Accelerated-RAN\nlibraries\nFujitsu software for Layer 2 functions\nRed Hat’s OpenShift Container Platform (OCP) as the container virtualization layer, enabling different types of applications to run on the same underlying GPU computing infrastructure\nA SoftBank-developed E2E AI and RAN orchestrator, to enable seamless provisioning of RAN and AI workloads based on demand and available capacity\nThe underlying hardware is the\nNVIDIA GH200 Grace Hopper Superchip\n, which can be used in various configurations from distributed to centralized RAN scenarios. This implementation uses multiple GH200 servers in a single rack, serving AI and RAN workloads concurrently, for an aggregated-RAN scenario. This is comparable to deploying multiple traditional RAN base stations.\nIn this pilot, each GH200 server was able to process 20 5G cells using 100-MHz bandwidth, when used in RAN-only mode. For each cell, 1.3 Gbps of peak downlink performance was achieved in ideal conditions, and 816Mbps was demonstrated with carrier-grade availability in the outdoor deployment.\nAI-RAN multi-tenancy achieved\nOne of the first principles of AI-RAN technology is to be able to run RAN and AI workloads concurrently and without compromising carrier-grade performance. This multi-tenancy can be either in time or space: dividing the resources based on time of day or based on percentage of compute. This also implies the need for an orchestrator that can provision, de-provision, or shift workloads seamlessly based on available capacity.\nAt the Fujisawa City trial, concurrent AI and RAN processing was successfully demonstrated over GH200 based on static allocation of resources between RAN and AI workloads (Figure 1).\nFigure 1. AI and RAN concurrency and total GPU utilization\nEach NVIDIA GH200 server constitutes multiple MIGs (Multi-Instance GPU), that enable a single GPU to be divided into multiple isolated GPU instances. Each instance has its own dedicated resources, such as memory, cache, and compute cores, and can operate independently.\nThe SoftBank orchestrator intelligently assigns whole GPUs or some MIGs within a GPU to run AI and some to run RAN workloads and switches them dynamically when needed. It is also possible to statically allocate a certain percentage of compute for RAN and AI, for example, 60% for RAN and 40% for AI instead of demand-based allocation.\nThe goal is to maximize capacity utilization. With AI-RAN, telcos can achieve almost 100% utilization compared to 33% capacity utilization for typical RAN-only networks. This is an increase of up to 3x while still catering to peak RAN loads, thanks to dynamic orchestration and prioritization policies.\nEnabling an AI-RAN marketplace\nWith a new capacity for AI computing now available on distributed AI-RAN infrastructure, the question arises of how to bring AI demand to this AI computing supply.\nTo solve this, SoftBank used a serverless API powered by NVIDIA AI Enterprise to deploy and manage AI workloads on AI-RAN, with security, scale, and reliability. The NVIDIA AI Enterprise serverless API is hosted on the AI-RAN infrastructure and integrated with the SoftBank E2E AI-RAN orchestrator. It connects to any public or private cloud running the same API, to dispatch external AI inferencing jobs to the AI-RAN server when compute is available (Figure 2).\nFigure 2. AI marketplace solution integrated with SoftBank AI-RAN\nThis solution enables an AI marketplace, helping SoftBank deliver localized, low-latency, secured inferencing services. It also demonstrated the importance of AI-RAN in helping telcos become the AI distribution grid, particularly for external AI inferencing jobs, and opened a new revenue opportunity.\nAI-RAN applications showcased\nIn this outdoor trial, new edge AI applications developed by SoftBank were demonstrated over the live AI-RAN network:\nRemote support of autonomous vehicles over 5G\nFactory multi-modal AI applications\nRobotics applications\nRemote support of autonomous vehicles over 5G\nThe key requirements of the social implementation of autonomous driving are vehicle safety and reducing operational costs.\nAt the Fujisawa City trial, SoftBank demonstrated an autonomous vehicle, relaying its front camera video using 5G to an AI-based remote support service hosted on the AI-RAN server. Multi-modal AI models analyzed the video stream, did risk assessment, and sent recommended actions to autonomous vehicles using text over 5G.\nThis is an example of explainable AI as well, as all the actions of the autonomous vehicle could be monitored and explained through summarized text and logging for remote support.\nFactory multi-modal AI applications\nIn this use case, multi-modal inputs including video, audio, and sensor data, are streamed using 5G into the AI-RAN server. Multiple LLMs, VLMs, retrieval-augmented generation (RAG) pipelines, and NVIDIA NIM microservices hosted on the AI-RAN server are used to coalesce these inputs and make the knowledge accessible through a chat interface to users using 5G.\nThis fits well for factory monitoring, construction site inspections, and similar complex indoor and outdoor environments. The use case demonstrates how edge AI-RAN enables local data sovereignty by keeping data access and analysis local, secure, and private, which is a mandatory requirement of most enterprises.\nRobotics applications\nSoftBank demonstrated the benefit of edge AI inferencing for a robot connected over 5G. A robodog was trained to follow a human based on voice and motion.\nThe demo compared the response time of the robot when the AI inferencing was hosted on the local AI-RAN server to when it was hosted on the central cloud. The difference was apparent and obvious. The edge-based inference robodog followed the human’s movements instantly, while the cloud-based inference robot struggled to keep up.\nAccelerating the AI-RAN business case with the Aerial RAN Computer-1\nWhile the AI-RAN vision has been embraced by the industry, the energy efficiency and economics of GPU-enabled infrastructure remain key requirements, particularly how they compare to traditional CPU– and ASIC-based RAN systems.\nWith this live field trial of AI-RAN, SoftBank and NVIDIA have not only proven that GPU-enabled RAN systems are feasible and high-performant, but they are also significantly better in energy efficiency and economic profitability.\nNVIDIA recently announced the\nAerial RAN Computer-1\nbased on the next-generation NVIDIA Grace Blackwell superchips as the recommended AI-RAN deployment platform. The goal is to migrate SoftBank 5G vRAN software from NVIDIA GH200 to NVIDIA Aerial RAN Computer-1 based on GB200-NVL2, which is an easier shift given the code is already CUDA-ready.\nWith\nGB200-NVL2\n, the available compute for AI-RAN will increase by a factor of 2x. The AI processing capabilities will improve by 5x for Llama-3 inferencing, 18x for data processing, and 9x for vector database search compared to prior H100 GPU systems.\nFor this evaluation, we compared the target deployment platform, Aerial RAN Computer-1 based on GB200 NVL2, with the latest generation of x86 and the best-in-class custom RAN product benchmarks and validated the following findings:\nAccelerated AI-RAN offers best-in-class AI performance\nAccelerated AI-RAN is sustainable RAN\nAccelerated AI-RAN is highly profitable\nAccelerated AI-RAN offers best-in-class AI performance\nIn 100% AI-only mode, each GB200-NVL2 server generates 25000 tokens\/second, which translates to $20\/hr of available monetizable compute per server, or $15K\/month per server.\nKeeping in mind that the average revenue per user (ARPU) of wireless services today ranges between $5–50\/month depending on the country, AI-RAN opens a new multi-billion-dollar AI revenue opportunity that is orders of magnitude higher than revenues from RAN-only systems.\nThe token AI workload used is Llama-3-70B FP4, showcasing that AI-RAN is already capable of running the world’s most advanced LLM models.\nAccelerated AI-RAN is sustainable RAN\nIn 100% RAN-only mode, GB200-NVL2 server power performance in Watt\/Gbps shows the following benefits:\n40% less power consumption than the best-in-class custom RAN-only systems today\n60% less power consumption than x86-based vRAN\nFor an even comparison, this assumes the same number of 100-MHz 4T4R cells and 100% RAN-only workload across all platforms.\nFigure 3. RAN power consumption and performance (watt\/Gbps)\nAccelerated AI-RAN is highly profitable\nFor this evaluation, we used the scenario of covering one district in Tokyo with 600 cells as the common baseline for RAN deployment for each of the three platforms being compared. We then looked at multiple scenarios for AI and RAN workload distribution, ranging from RAN-only to RAN-heavy or AI-heavy.\nIn the AI-heavy scenario (Figure 4), we used a one-third RAN and two-third AI workload distribution:\nFor every dollar of CapEx investment in accelerated AI-RAN infrastructure based on NVIDIA GB200 NVL2, telcos can generate 5x the revenue over 5 years.\nFrom an ROI perspective, the overall investment delivers a 219% return, considering all CapEx and OpEx costs.This is of course specific to SoftBank, as it uses local country costs assumptions.\nFigure 4. AI-RAN economics for covering one Tokyo district with 600 cells\n33% AI and 67% RAN\n67% AI and 33% RAN\n$ of revenue per $ of CapEx\n2x\n5x\nROI %\n33%\n219%\nTable 1. AI-heavy scenario compared to RAN-heavy results\nIn the RAN-heavy scenario, we used two-thirds RAN and one-third AI workload distribution and found that revenue divided by CapEx for NVIDIA-accelerated AI-RAN is 2x, with a 33% ROI over 5 years, using SoftBank local cost assumptions.\nIn the RAN-only scenario, NVIDIA Aerial RAN Computer-1 is more cost-efficient than custom RAN-only solutions, which underscores the benefits of using accelerated computing for radio signal processing.\nFrom these scenarios, it is evident that AI-RAN is highly profitable as compared to RAN-only solutions, in both AI-heavy and RAN-heavy modes. In essence, AI-RAN transforms traditional RAN from a cost center to a profit center.\nThe profitability per server improves with higher AI use. Even in RAN-only, AI-RAN infrastructure is more cost-efficient than custom RAN-only options.\nKey assumptions used for the revenue and TCO calculations include the following:\nThe respective number of platforms, servers, and racks for each platform are calculated using a common baseline of deploying 600 cells on the same frequency, 4T4R.\nThe total cost of ownership (TCO) is calculated over 5 years and includes the cost of hardware, software, and vRAN and AI operating costs.\nFor the new AI revenue calculation, we used $20\/hr\/server based on GB200 NVL2 AI performance benchmarks.\nOpEx costs are based on local Japan power costs and aren’t extensible worldwide.\nROI % = (new AI revenues – TCO) \/ TCO\nThis validation of AI revenue upside, energy efficiency, and profitability of AI-RAN leaves no doubts about the feasibility, performance, and economic benefits of the technology.\nGoing forward, exponential gains with each generation of NVIDIA superchips, such as Vera Rubin, will multiply these benefits by orders of magnitude further, enabling the much-awaited business transformation of telco networks.\nLooking ahead\nSoftBank and NVIDIA are\ncontinuing to collaborate\ntoward the commercialization of AI-RAN and bringing new applications to life. The next phase of the engagements will entail work on AI-for-RAN to improve spectral efficiency and on NVIDIA Aerial Omniverse digital twins to simulate accurate physical networks in the digital world for fine-tuning and testing.\nNVIDIA AI Aerial lays the foundation for operators and ecosystem partners globally to use the power of accelerated computing and software-defined RAN + AI to transform 5G and 6G networks. You can now use NVIDIA Aerial RAN Computer-1 and AI Aerial software libraries to develop your own implementation of AI-RAN.\nNVIDIA AI Enterprise is also helping create new AI applications for telcos, hostable on AI-RAN, as is evident from this trial where many NVIDIA software toolkits have been used. This includes NIM microservices for generative AI, RAG, VLMs, NVIDIA Isaac for robotics training, NVIDIA NeMo, RAPIDS, NVIDIA Triton for inferencing, and a serverless API for AI brokering.\nThe telecom industry is at the forefront of a massive opportunity to become an AI service provider. AI-RAN can kickstart this new renaissance for telcos worldwide, using accelerated computing as the new foundation for wireless networks.\nThis announcement marks a breakthrough moment for AI-RAN technology, proving its feasibility, carrier-grade performance, superior energy efficiency, and economic value. Every dollar of CapEx invested in NVIDIA-accelerated AI-RAN infrastructure generates 5x revenues, while being 6G-ready.\nThe journey to AI monetization can start now.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/ai-ran-goes-live-and-unlocks-a-new-ai-opportunity-for-telcos\/","jp_title":"AI-RAN が通信事業者向けに新しい AI のビジネス チャンスをもたらす","jp_content":"Reading Time:\n4\nminutes\nAI は、業界、企業、消費者の体験を新しい方法で変革しています。 生成 AI モデルは推論に移行し、\nエージェント型 AI\nは新しい結果重視のワークフローを可能にし\nフィジカル AI\nにより、カメラ、ロボット、ドローン、自動車などのエンドポイントがリアルタイムで意思決定を行い、対話できるようになります。\nこれらのユース ケースに共通するのは、普及し、信頼性が高く、安全で、超高速な接続が必要であることです。\n通信ネットワークは、フロントホール無線アクセス ネットワークを介して直接送信されるか、エンタープライズ アプリケーションによって生成されるパブリック クラウドまたはプライベート クラウドからのバックホールからの完全にスタンドアロンの AI 推論トラフィックのような新しい種類の AI トラフィックに備える必要があります。\nローカル ワイヤレス インフラストラクチャは、AI 推論を処理するのに最適な場所を提供します。 これは、通信会社 ネットワークに対する新しいアプローチである AI 無線アクセス ネットワーク (\nAI-RAN\n) の特徴です。\n従来の CPU または ASIC ベースの RAN システムは、RAN のみのために設計されており、現在では AI トラフィックを処理できません。 AI-RAN は、ワイヤレスと AI のワークロードを同時に実行できる共通の GPU ベースのインフラストラクチャを提供します。これにより、ネットワークを単一目的から多目的インフラストラクチャに変え、コスト センターからプロフィット センターに変えられます。\n適切な種類のテクノロジに戦略的投資を行うことで、通信会社は業界、消費者、企業にわたって AI の作成、配信、使用を容易にする、 AI グリッドへと飛躍することができます。今が通信会社にとって、中央集中的で分散されたインフラストラクチャを再利用することで、AI トレーニング (作成) と AI 推論 (配信) のためのファブリックを構築する大きな機会となります。\nSoftBank と NVIDIA が AI-RANの商用化を進める\nSoftBank は、NVIDIA アクセラレーション ハードウェアと NVIDIA Aerial ソフトウェアを技術基盤として活用し、\n神奈川県藤沢市で屋外\nフィールド トライアルを成功させ、\nAI-RAN ビジョンを\n現実のものにしました。\nこの達成は、AI-RAN の商用化に向けた大きな前進であり、テクノロジの実現性、パフォーマンス、収益化に関する業界の要件に対応する実証ポイントを提供します。\nNVIDIA のアクセラレーテッド コンピューティング プラットフォームで実行される世界初の屋外 5G AI-RAN フィールド トライアル。 これは、5G コアと統合されたフルスタックの仮想 5G RAN ソフトウェアに基づくエンドツーエンドのソリューションです。\nキャリア グレードの仮想 RAN のパフォーマンスを実現。\nAI と RAN のマルチテナントとオーケストレーションを実現。\nエネルギー効率と経済的なメリットが、既存のベンチマークと比較して検証されました。\nAI-RAN インフラストラクチャに統合された AI マーケットプレイスを提供する新しいソリューション。\nAI-RAN ネットワークで実行される実際の AI アプリケーションが紹介されます。\n何よりも、SoftBank は、世界中に展開するために、独自の AI-RAN 製品を商業的にリリースすることを目指しています。\n他の通信事業者が今すぐ AI-RAN の導入を支援するために、SoftBank は、AI-RAN を試用するために必要なハードウェアとソフトウェアの要素で構成されたリファレンス キットを、簡単かつ迅速に提供する予定です。\nエンドツーエンドの AI-RAN ソリューションとフィールド トライアルの結果\nSoftBank は、NVIDIA とエコシステム パートナーのハードウェアとソフトウェア コンポーネントを統合し、キャリアグレードの要件を満たすように強化することで、AI-RAN ソリューションを開発しました。 このソリューションは、NVIDIA GH200 (CPU+GPU)、NVIDIA Bluefield-3 (NIC\/DPU)、フロントホールおよびバックホール ネットワーキング用の Spectrum-X で実行される 100% ソフトウェア デファインドの完全な 5G vRAN スタックが実現します。 20 台の無線ユニットと 5G コア ネットワークを統合し、100 台のモバイル UE を接続します。\nコア ソフトウェア スタックには、以下のコンポーネントが含まれています。\nSoftBank が\nNVIDIA Aerial CUDA-Accelerated-RAN\nライブラリを使用して、 5G RAN レイヤー 1 のチャネル マッピング、チャネル推定、変調、前方エラー訂正などの機能を開発し、最適化しました。\nレイヤー 2 機能向け Fujitsu ソフトウェア\nコンテナーの仮想化レイヤーとしての Red Hat の OpenShift Container Platform (OCP) により、同じ基盤となる GPU コンピューティング インフラストラクチャで異なるタイプのアプリケーションが実行されます\nSoftBank が開発した E2E、AI と RAN オーケストレーター。需要と使用可能な容量に基づいて RAN と AI のワークロードのシームレスなプロビジョニングを可能にします。\n基盤となるハードウェアは、\nNVIDIA GH200 Grace Hopper Superchip\nであり、分散型から集中型 RAN シナリオまで、さまざまな構成で使用できます。 この実装では、集約された RAN のシナリオのために、1 つのラックで複数の GH200 サーバーを使用し、AI と RAN のワークロードを同時に処理します。 これは、従来の RAN 基地局を複数展開するのに相当します。\nこのパイロットでは、RAN のみのモードで使用された場合、各 GH200 サーバーは、100 MHz 帯域幅で 20 個の 5G セルを処理することができました。 各セルでは、理想的な条件下で 1.3 Gbps のピーク ダウンリンク性能が達成され、屋外展開ではキャリアグレードの可用性で 816 Mbps が実証されました。\nAI-RAN のマルチテナントを実現\nAI-RAN テクノロジの第一の原則の 1 つは、キャリアグレードのパフォーマンスを損なうことなく、RAN と AI のワークロードを同時に実行できることです。 このマルチテナントは、時間または空間のいずれかで実行でき、時間帯またはコンピューティングの割合に基づいてリソースを分割します。 また、これは、使用可能な容量に基づいて、ワークロードをシームレスにプロビジョニング、プロビジョニングの解除、シフトできるオーケストレーターの必要性も意味します。\n藤沢市の実証実験では、RAN と AI ワークロード間のリソースの静的割り当てに基づいて、GH200 上での AI と RAN の同時処理が実証されました。 (図 1)。\n図 1. AI と RAN の同時処理と GPU の合計使用率\n各 NVIDIA GH200 サーバーは、複数の MIG (マルチインスタンス GPU) で構成され、1 つの GPU を複数の独立した GPU インスタンスに分割できます。 各インスタンスには、メモリ、キャッシュ、コンピューティング コアなど、独自の専用リソースがあり、独立して動作でき��す。\nSoftBank オーケストレーターは、AI を実行するために GPU 全体または GPU の一部をインテリジェントに割り当て、RAN のワークロードを実行し、必要に応じて動的に切り替えます。 需要に基づく割り当てではなく、RAN と AI に一定の割り当てを、RAN に 60% と AI に 40% のコンピューティングを静的に割り当てることもできます。\n目標は、容量使用率を最大化することです。 AI-RAN を使用すると、通信会社は、通常の RAN のみのネットワークでの 33% の容量使用率と比較して、ほぼ 100% の使用率を実現できます。 これは、動的なオーケストレーションと優先順位付けポリシーのおかげで、ピークの RAN の負荷に対応しながら、最大 3 倍の増加です。\nAI-RAN マーケットプレイスの実現\n分散型 AI-RAN インフラストラクチャで AI コンピューティングの新しい機能が利用できるようになったため、この AI コンピューティングの供給に AI の需要をどのように取り込むかという疑問が生じます。\nこの問題を解決するために、SoftBank は、NVIDIA AI エンタープライズ を活用したサーバーレス API を使用して、セキュリティ、拡張性、信頼性を備えて AI-RAN で AI ワークロードを展開し、管理しました。 NVIDIA AI エンタープライズのサーバーレス API は、AI-RAN インフラストラクチャでホストされ、SoftBank E2E AI-RAN オーケストレーターと統合されています。 同じ API を実行するパブリック クラウドまたはプライベート クラウドに接続し、コンピューティングが利用可能になったときに、外部の AI 推論ジョブを AI-RAN サーバーに割り当てます (図 2)。\n図 2. SoftBank AI-RAN と統合された AI マーケットプレイス ソリューション\nこのソリューションにより AI マーケットプレイスが実現し、ソフトバンクはローカライズされた低遅延の安全な推論サービスを提供できるようになります。  また、特に外部の AI 推論の仕事のために、通信会社が AI 配信グリッドになるのを支援する上で AI-RAN の重要性も実証し、新しい収益の機会を作ります。\nAI-RAN アプリケーションが紹介\nこの屋外の試用では、SoftBank が開発した新しいエッジ AI アプリケーションがライブ AI-RAN ネットワークでデモンストレーションされました。\n5G を介した自動運転車のリモート サポート\n工場出荷時のマルチモーダル\nロボティクス アプリケーション\n5G を介した自動運転車のリモート サポート\n自動運転の社会的実装の重要な要件は、車の安全性と運用コストの削減です。\n藤沢市の実証実験では、ソフトバンクが自動運転車を実演し、前方カメラの映像を 5G で AI-RAN サーバーにホストされた AI ベースの遠隔サポート サービスに中継した。 マルチモーダル AI モデルは、ビデオ ストリームを分析し、リスク評価を行い、5G を介したテキストを使用して自動運転車に推奨のアクションを送信しました。\nこれは、説明可能な AI の例でもあります。リモート サポートのための要約されたテキストとログを通じて、自動運転車のすべての動作を監視し、説明することができました。\n工場出荷時のマルチモーダル\nこのユース ケースでは、ビデオ、オーディオ、センサー データを含むマルチモーダル入力が、5G を使用して AI-RAN サーバーにストリーミングされます。 AI-RAN サーバーでホストされる、複数の LLM、VLM、検索拡張生成 (RAG) パイプライン、NVIDIA NIM マイクロサービスは、これらの入力を統合し、5G を使用するユーザーがチャット インターフェイスを介して情報にアクセスできるようにするために使用されます。\nこれは、工場の監視、建設現場の検査、同様の複雑な屋内および屋外の環境に最適です。 このユース ケースでは、エッジ AI-RAN がデータ アクセスと分析をローカル、安全、プライベートに保つことで、ローカル データの主権を実現する方法を示しています。これは、ほとんどの企業にとって必須の要件です。\nロボティクス アプリケーション\nSoftBank は、5G を介して接続されたロボットのエッジ AI 推論の利点を実証しました。 ロボドッグは、声と動きに基づいて人間を追うようにトレーニングされました。\nこのデモでは、AI 推論がローカル AI-RAN サーバーでホストされたときのロボットの応答時間と、セントラル クラウドでホストされた��きの応答時間を比較しました。 その違いは明白でした。 エッジ ベースの推論 ロボドッグは、人間の動きを即座に追跡しましたが、クラウド ベースの推論ロボットは、追いつくのに苦労しました。\nAerial RAN Computer-1 で AI-RAN のビジネス ケースを高速化\nAI-RAN ビジョンは業界で受け入れられていますが、GPU 対応インフラストラクチャのエネルギー効率と経済性、特に従来の CPU および ASIC ベースの RAN システムとの比較は依然として重要な要件です。\nAI-RAN のこのライブ フィールド トライアルにより、SoftBank と NVIDIA は、GPU 対応の RAN システムが実現可能で、高性能であることを実証しただけでなく、エネルギー効率と経済的な収益性も大幅に向上していることを実証しました。\nNVIDIA は最近、次世代 NVIDIA Grace Blackwell Superchip をベースにした\nAerial RAN Computer-1\nを推奨 AI-RAN 展開プラットフォームとして発表しました。 目的は、GB200-NVL2 をベースとした SoftBank 5G vRAN ソフトウェアを NVIDIA GH200 から NVIDIA Aerial RAN Computer-1 に移行することです。これは、コードがすでに CUDA に対応しているため、移行が容易です。\nまた、\nGB200-NVL2\nを使用すると、AI-RAN で利用可能なコンピューティング能力が 2 倍になります。 AI 処理機能は、以前の H100 GPU システムと比較して、Llama-3 推論が 5 倍、データ処理が 18 倍、ベクトル データベース検索が 9 倍に改善されます。\nこの評価のために、ターゲットの展開 プラットフォーム、GB200 NVL2 をベースとする Aerial RAN Computer-1、最新世代の x86 とクラス最高のカスタム RAN 製品ベンチマークを比較し、以下の結果を検証しました。\n高速化された AI-RAN は、クラス最高の AI パフォーマンスを提供します\n高速化された AI-RAN は持続可能な RAN\n高速化された AI-RAN は、非常に収益性が高い\n高速化された AI-RAN は、クラス最高の AI パフォーマンスを提供します\n100% AI のみのモードでは、各 GB200-NVL2 サーバーは、毎秒 25,000 トークンを生成します。これは、サーバー 1 台の収益化可能なコンピューティングの利用率が 20 ドル\/時間、またはサーバーあたりの月15,000 ドルに換算します。\n現在のワイヤレス サービスのユーザー 1 人の平均収益 (ARPU) は、国によっては月 5 ~ 50 ドルの範囲であることに留意して、AI-RAN は、RAN のみのシステムよりも数倍の高い、数十億ドル規模の AI 収益の機会を提供します。\n使用されるトークン AI ワークロードは、Llama-3-70B FP4 であり、AI-RAN がすでに世界で最も高度な LLM モデルを実行できることを実証します。\n高速化された AI-RAN は持続可能な RAN\n100% RAN のみのモードでは、GB200-NVL2 サーバーの電力パフォーマンスは、ワット\/Gbps で以下の利点があります。\n今日、クラス最高のカスタム RAN のみのシステムと比較して、消費電力が 40% 削減\nx86 ベースの vRAN と比較して、消費電力が 60% 削減\n比較のために、これはすべてのプラットフォームで同じ数の 100 MHz 4T4R セルと、100% RAN のみのワークロードを想定しています。\n図 3. RAN の消費電力とパフォーマンス (ワット\/Gbps)\n高速化された AI-RAN は、非常に収益性が高い\nこの評価のために、比較された 3 つのプラットフォームのそれぞれで RAN 展開の共通のベースラインとして、東京都の 1 地区を 600 セルでカバーするシナリオを使用しました。 次に、RAN のみから RAN を重くするまたは AI を重視するまで、AI と RAN のワークロード分布の複数のシナリオを調べました。\nAI が多いシナリオ (図 4) では、RAN が 3 分の 1、AI ワークロードが 3 分の 2 を分散しました。\nNVIDIA GB200 NVL2 をベースとする高速化された AI-RAN インフラストラクチャへの資本支出 (CapEx) 投資額の1ドルに対して、通信会社は 5 年間で 5 倍の収益を生み出すことができます。\nROI の観点から、資本支出と運用支出のすべてのコストを考慮して、投資全体は 219% のリターンを実現します。これは、現地のコスト想定を使用しているため、もちろん SoftBank 特有のものです。\n図 4. 600 セルで 1 つの東京都地区をカバーする AI-RAN の経済性\n33% AIと 67% RAN\n67% AI と 33% RAN\nCapEx 1 ドルあたりの収益 $\n2x\n5x\nROI %\n33%\n219%\n表 1. AI を多用するシナリオと比較した結果\nRAN を多用するシナリオでは、3 分の 2 を RAN、3 分の 1 を AI ワークロード分散に使用し、NVIDIA アクセラレーション AI-RAN の CapEx で割った収益は 2 倍になり、SoftBank のローカル コスト想定を使用して 5 年間で 33% の ROI が得られることがわかりました。\nRAN のみのシナリオでは、NVIDIA Aerial RAN Computer-1 はカスタム RAN のみのソリューションよりもコスト効率が高く、無線信号処理にアクセラレーテッド コンピューティングを使用する大きな利点となります。\nこれらのシナリオから、AI を多用するモード RAN を多用するモードの両方で、RAN のみのソリューションと比較して、AI-RAN が高い収益性が明らかになります。 本質的に、AI-RAN は、従来の RAN をコスト センターから利益センターに変革します。\nAI の使用量の増加により、サーバーあたりの収益性が向上します。 RAN のみの場合でも、AI-RAN インフラストラクチャは、カスタム RAN のみのオプションよりもコスト効率が高くなります。\n収益と TCO の計算に使用された主な前提条件には、次のものが含まれます。\n各プラットフォームのプラットフォーム、サーバー、ラックのそれぞれの数は、同じ周波数である 4T4R で 600 セルをデプロイする共通のベースラインを使用して計算されます。\n総所有コスト (TCO) は、5 年以上で計算されており、ハードウェア、ソフトウェア、vRAN、AI の運用コストが含まれています。\n新しい AI 収益の計算には、GB200 NVL2 AI パフォーマンス ベンチマークに基づいて、サーバーあたりの時間 20 ドルを使用しました。\n運用支出コストは、日本の現地の電力コストに基づいており、世界的に拡張することはできません。\nROI % = (新しい AI 収益 – TCO) \/ TCO\nAI の収益の向上、エネルギー効率、収益性、収益性のこの検証により、このテクノロジの実現性、パフォーマンス、経済的なメリットに疑いの余地はありません。\n今後、Vera Rubin などの NVIDIAスーパーチップの各世代が指数関数的に増加することで、これらのメリットはさらに桁違いに増大し、待望の通信ネットワークのビジネス変革が可能になります。\n将来を見据える\nSoftBank と NVIDIA は、AI-RAN の商業化と新しいアプリケーションを生み出すために、\n継続的に協力\nしています。 この契約の次のフェーズでは、スペクトル効率を向上させる AI-for-RAN の取り組みと、ファインチューニングとテストのためにデジタル ネットワークをシミュレートする NVIDIA Aerial Omniverse デジタル ツインの取り組みが含まれます。\nNVIDIA AI Aerial は、世界中の通信事業者とエコシステム パートナーが、アクセラレーテッド コンピューティングとソフトウェア デファインド RAN + AI のパワーを使用して、5G および 6G ネットワークを変革する基盤を築きます。 NVIDIA Aerial RAN Computer-1 と AI Aerial ソフトウェア ライブラリを使用して、独自の AI-RAN 実装を開発できるようになりました。\nNVIDIA AI エンタープライズ は、多くの NVIDIA ソフトウェア ツールキットが使用されたこのトライアルからも明らかなように、AI-RAN でホスト可能な通信事業者向けの新しい AI アプリケーションの作成にも貢献しています。これには、生成 AI 向けの NIM マイクロサービス、RAG、VLM、ロボティクス トレーニング用の NVIDIA Isaac、NVIDIA NeMo、RAPIDS、推論用の NVIDIA Triton、AI ブローカー用サーバーレス API が含まれます。\n通信業界は、AI サービス プロバイダーになる大きなチャンスの最前線に立っています。 AI-RAN は、ワイヤレス ネットワークの新しい基盤としてアクセラレーテッド コンピューティングを使用することで、世界中の通信会社にとってこの新しい変革を促進できます。\nこの発表は、AI-RAN テクノロジの画期的な瞬間であり、その実現性、キャリアグレードのパフォーマンス、優れたエネルギー効率、経済的な価値を証明しました。 NVIDIA の高速化された AI-RAN インフラストラクチャに投資された資本支出 1 ドルは、6G に対応しながら、5 倍の収益を生み出します。\nAI 収益化への取り組みは、今すぐ始められます。\n関連情報\nGTC セッション:\n通信会社が国家 AI インフラストラクチャとプラットフォームをどのように実現するか\nGTC セッション:\n現代の通信会社 Blueprint: AI を使用して変革と再発明\nGTC セッション:\n人工知能が通信を変革する 3 つの方法\nSDK:\nAerial Omniverse デジタル ツイン\nウェビナー:\nHow Telcos Transform Customer Experiences with Conversational AI\nウェビナー:\n多言語音声 AI カスタマイズされたエージェントアシストで通信会社 コンタクト センター エージェントの強化"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/developing-a-172b-llm-with-strong-japanese-capabilities-using-nvidia-megatron-lm\/","en_title":"Developing a 172B LLM with Strong Japanese Capabilities Using NVIDIA Megatron-LM","en_content":"Generative AI has the ability to create entirely new content that traditional machine learning (ML) methods struggle to produce. In the field of natural language processing (NLP), the advent of\nlarge language models (LLMs)\nspecifically has led to many innovative and creative AI use cases. These include customer support chatbots, voice assistants, text summarization and translation, and more—tasks previously handled by humans.\nLLMs continue to evolve through various approaches, including increasing the number of parameters and the adoption of new algorithms like Mixture of Experts (MoE). The application and adaptation of LLMs are anticipated across many industries, including retail, manufacturing, and finance.\nHowever, many models that currently top the LLM leaderboard show insufficient understanding and performance in non-English languages, including Japanese. One of the reasons for this is that the training corpus contains a high proportion of English data. For example,\nonly 0.11% of the GPT-3 corpus is Japanese data\n. Creating LLM models that perform well in Japanese, which has less training data than English, has been immensely challenging.\nThis post presents insights gained from training an AI model with 172 billion parameters as part of the\nGenerative AI Accelerator Challenge (GENIAC)\nproject, using\nNVIDIA Megatron-LM\nto help address the shortage of high-performance models for Japanese language understanding.\nLLM-jp initiatives at GENIAC\nThe\nMinistry of Economy, Trade and Industry (METI)\nlaunched GENIAC to raise the level of platform model development capability in Japan and to encourage companies and others to be creative. GENIAC has provided computational resources, supported matching with companies and data holders, fostered collaboration with global technology companies, held community events, and evaluated the performance of the developed platform models.\nThe\nLLM-jp\nproject to develop a completely\nopen model with 172 billion parameters\n(available on Hugging Face) with strong Japanese language capabilities was selected for the GENIAC initiative. LLM-jp 172B was the largest model development in Japan at that time (February to August 2024), and it was meaningful to share the knowledge of its development widely.\nLLM-jp is an initiative launched by researchers in the field of natural language processing and computer systems, mainly at NII, to accumulate know-how on the mathematical elucidation of training principles, such as how large-scale models acquire generalization performance and the efficiency of learning, through the continuous development of models that are completely open and commercially available. The objective is to accumulate know-how on the efficiency of training.\nTraining the model using NVIDIA Megatron-LM\nMegatron-LM\nserves as a lightweight research-oriented framework leveraging\nMegatron-Core\nfor training LLMs at unparalleled speed. Megatron-Core, the main component, is an open-source library that contains GPU-optimized techniques and cutting-edge system-level optimizations essential for large-scale training.\nMegatron-Core supports various advanced model parallelism techniques, including tensor, sequence, pipeline, context, and MoE expert parallelism. This library offers\ncustomizable building blocks\n, training resiliency features such as\nfast distributed checkpointing\n, and many other innovations such as\nMamba-based hybrid model training\n. It’s compatible with all NVIDIA Tensor Core GPUs, and includes support for\nTransformer Engine (TE)\nwith FP8 precision introduced with\nNVIDIA Hopper architecture\n.\nModel architecture and training settings\nTable 1 provides an overview of the model architecture for this project, which follows\nLlama 2 architecture\n.\nParameter\nValue\nHidden size\n12288\nFFN intermediate size\n38464\nNumber of layers\n96\nNumber of attention heads\n96\nNumber of query groups\n16\nActivation function\nSwiGLU\nPosition embedding\nRoPE\nNormalization\nRMSNorm\nTable 1. Overview of LLM-jp 172B model architecture\nThe LLM-jp 172B model is being trained from scratch using 2.1 trillion tokens of a multilingual corpus developed for the project consisting mainly of Japanese and English. The training is performed using NVIDIA H100 Tensor Core GPUs on Google Cloud A3 Instance with FP8 hybrid training using the Transformer Engine. Megatron-Core v0.6 and Transformer Engine v1.4 are used in the experiment.\nTable 2 shows hyperparameter settings for training.\nParameter\nValue\nLR\n1E-4\nmin LR\n1E-5\nLR WARMUP iters\n2000\nWeight decay\n0.1\nGrad clip\n1.0\nGlobal batch size\n1728\nContext length\n4096\nTable 2. Hyperparameters used for the model training\nIn addition, z-loss and batch-skipping techniques, which are used in\nPaLM\n, are incorporated to stabilize the training process, and flash attention is used to further speed up the training process.\nTo view other training configurations, please see\nllm-jp\/Megatron-LM\n.\nTraining throughput and results\nPretraining for the latest LLM-jp 172B model is currently underway, with periodic evaluations every few thousand iterations to monitor training progress and ensure successful accuracy results on Japanese and English downstream tasks (Figure 1). So far, over 80% is complete, of the targeted 2.1 trillion tokens.\nFigure 1. Training loss curves for pretraining with 1.7 trillion tokens using Megatron FP8 hybrid training\nNotably, there is a sharp increase in TFLOP\/s after approximately 7,000 iterations, corresponding to the transition from BF16 to FP8-hybrid precision. In this experiment, BF16 plus TE was used for training before 7,000 iterations, and FP8 hybrid plus TE was used after 7,000 iterations. In Megatron-LM, it is possible to enable hybrid FP8 training with the simple option\n--fp8-format\n‘\nhybrid\n‘. Note that this feature is experimental, with further optimizations coming soon.\nFigure 2. Training throughput (TFLOP\/s) when TE is used with BF16 and FP8 hybrid\nThe reason we started the training with BF16 plus TE and then switched to FP8 hybrid was not only to see the tokens\/sec performance difference between BF16 and FP8, but also to make the initial training more stable. In the early stages of training, the learning rate (LR) increases due to the warm-up, leading to unstable training.\nWe chose to perform the initial training with BF16, and after confirming that there were no problems with the values of training loss, optimizer states, gradient norm, and so on, we switched to FP8 to speed up the training process. FP8 hybrid has improved the training speed. We observed a training speed of 545-553 TFLOP\/s with Megatron-LM.\nFigure 3. Weak scaling performance based on the results of the main and preliminary experiments of the LLM-jp 172B model training\nConclusion\nAs mentioned above, the training of LLM-jp 172B  is still ongoing using Megatron-LM. Based on the evaluation results of downstream tasks using the current checkpoint data, we suppose that the model has already acquired excellent Japanese language capabilities, but the complete model is expected to be ready early next year.Training time is often a significant challenge in pretraining LLMs, where vast datasets are required.Therefore, efficient training frameworks like Megatron-LM are crucial for accelerating Generative AI research and development. For the 172B model trained with\nMegatron-LM\n, we explored FP8-hybrid training as a potential method for improving training speed, achieving a 1.4x training speed acceleration from 400 TFLOP\/s to 550 TFLOP\/s. We observed a performance acceleration from 400 TFLOP\/s to 550 TFLOP\/s, suggesting that FP8-hybrid could be a valuable approach for enhancing the efficiency of large-scale model pretraining.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/developing-a-172b-llm-with-strong-japanese-capabilities-using-nvidia-megatron-lm\/","jp_title":"Megatron-LM を用いた日本語に強い 172B 大規模言語モデルの開発","jp_content":"Reading Time:\n2\nminutes\n生成 AI は、その卓越した能力のおかげで、従来の機械学習手法ではできなかったタスクを実行し、注目を集めています。例えば、自然言語処理の分野では、\n大規模言語モデル (LLM)\nが登場したことで、チャットボットによるカスタマー サポートや会議内容の要約など、これまで人間が担っていた役割を AI が代わりに行うなど多くの革新的で創造的なユース ケースが生まれています。\nLLM は、パラメーター数の増加や MoE (Mixture of Experts) のような新しいアルゴリズムの採用など、様々なアプローチを通じて進化し続けており、小売業、製造業、金融業など、さまざまな業界への応用と適用が期待されています。\nしかし、現在 LLM リーダーボードの上位モデルの多くは、英語に比べて日本語の理解度やパフォーマンスが低い傾向にあります。その理由の一つは、学習コーパスの英語データの割合が大きいことです。例えば、\nGPT-3 の場合、日本語データはコーパスの 0.11% しかありません\n。日本の生成 AI の発展のためには、非常に困難ですが英語よりも学習データの少ない日本語で優れた性能を発揮する LLM モデルを作成することが、乗り越えるべき重要な課題です。\n本稿では、\nGENIAC (Generative AI Accelerator Challenge)\nプロジェクトの一環として取り組んだ、Megatron-LM を用いた 172B 大規模言語モデルの学習から得られた知見を紹介し、データ不足の問題を乗���越えて日本語理解能力の高いモデル作成に取り組んだ際の洞察について紹介します。\nGENIAC における LLM-jp の取り組み\n上記で述べたような課題を解決するために、経済産業省は、日本国内のプラットフォーム モデル開発力の向上と企業等の創意工夫を奨励するため、「\nGenerative AI Accelerator Challenge (GENIAC)\n」を立ち上げました。GENIAC では、計算資源の提供、企業とデータ保有者とのマッチング支援、グローバルテック企業との連携促進、コミュニティ イベントの開催、開発されたプラットフォーム モデルの性能評価などを現在も継続して行っています。\nこの取り組みに、\nLLM-jp\nの日本語対応力に優れた\n完全オープンな 172B モデル\nの開発というテーマが選ばれました。172B は当時 (2024 年 2 月から 8 月) 日本国内で最大規模のモデル開発であり、その開発ノウハウを広く共有することは非常に有意義なことでした。\nLLM-jp は、\nNII (国立情報学研究所)\nを中心とした自然言語処理や計算機システム分野の研究者が中心となって立ち上げた取り組みで、大規模モデルが汎化性能を獲得する仕組みや学習の効率性といった学習原理の数学的解明に関するノウハウを、完全にオープンで商用利用可能なモデルの継続的な開発を通じて蓄積する事、および学習の効率性に関するノウハウを蓄積することを目的としています。\nNVIDIA Megatron-LM\nMegatron-LM\nは、\nMegatron-Core\nを活用して大規模言語モデル (LLM) を比類のない速度で学習する軽量な研究指向フレームワークとして機能します。主要コンポーネントである Megatron-Core は、大規模な学習に不可欠な GPU 最適化技術と最先端のシステム レベルの最適化を含むライブラリです。\nMegatron-Core は、テンソル、シーケンス、パイプライン、コンテキスト、MoE エキスパート並列処理など、さまざまな高度なモデル並列処理手法をサポートしています。このライブラリは、\nカスタマイズ可能なビルディング ブロック\n、\n高速分散チェックポイント\nなどの学習回復力機能、\nMamba ベースのハイブリッド モデル学習\nなどの他の多くのイノベーションを提供します。すべての NVIDIA Tensor コア GPU と互換性があり、\nNVIDIA Hopper アーキテクチャ\nで導入された FP8 精度の Transformer Engine テクノロジのサポートが含まれています。\n上記のような最先端の機能を提供することで、Megatron-LM は、研究者やモデル開発者が 1,000 億のパラメーターを超えるモデルでも、高速な学習と数千の GPU スケールへのスケーラビリティを実現できるようにします。\nモデル アーキテクチャと学習設定\n以下は、\nMeta の Llama2\nアーキテクチャに準拠したこのプロジェクトのモデル アーキテクチャの概要です。\nパラメーター\n値\nHidden size\n12288\nFFN Intermediate size\n38464\nNumber of layers\n96\nNumber of attention heads\n96\nNumber of query groups\n16\nActivation function\nSwiGLU\nPosition embedding\nRoPE\nNormalization\nRMSNorm\n表 1. LLM-jp 172B モデルアーキテクチャ概要\nこの 172B モデルは、プロジェクト用に開発された多言語コーパス (主に日本語と英語) の 2.1T トークン (2.1 兆トークン) を使用してゼロから学習されています。学習は、Transformer Engine を使用した FP8 ハイブリッド学習で、Google Cloud の A3 インスタンス上の H100 Tensor コア GPU を使用して実行されています。実験では、\nMegatron-Core\nv0.6 と\nTransformer Engine\nv1.4 が使用されています。\n学習のハイパーパラメーター設定は次のとおりです。\nパラメーター\n値\nLR\n1E-4\nmin LR\n1E-5\nLR WARMUP iters\n2000\nWeight Decay\n0.1\nGrad Clip\n1.0\nglobal batch size\n1728\ncontext length\n4096\n表 2. この実験で使用したハイパーパラメーターの概要\n詳細な設定に興味のある方は、他の学習設定も\nllm-jp\/Megatron-LM\nでご覧いただけます。\nまた、\nPaLM\nで採用されている z-loss や batch-skipping テクニックを取り入れることで学習プロセスを安定化させ、flash attention を利用することで学習プロセスをさらに高速化させています。\n学習結果とスループット\nLLM-jp 172B モデルの事前学習は、数千イテレーションごとに、日本語と英語の下流タスクの評価結果をモニターし、学習がうまく進んでいるかどうかを確認しながら現在も進行中です。これまでのところ、目標とする 2 兆 1,000 億トークンの 80% 強まで完了しています。\nMegatron の FP8 ハイブリッド学習を用いた 1.7 兆トークンの事前学習における学習損失曲線を以下に示します。この曲線は、240,000 ステップまで損失が着実に減少していることを示しています。\n図 1. 240k ステップまでの学習ロス\n以下のグラフは、Y 軸は TFLOP\/s、X 軸はイテレーション回数を示しています。注目すべきは、学習を BF16 から FP8 ハイブリッドへ切り替えた約 7,000 回のイテレーションのタイミングで、TFLOP\/s が急激に増加していることです。この実験では、BF16 + Transformer Engine が 7,000 回以前の学習に使用され、FP8 ハイブリッド + Transformer Engine が 7000 回以降の学習に使用されました。Megatron-LM では、単純なオプション\n--fp8-format\n‘\nhybrid\n‘ で FP8 ハイブリッド学習を有効にすることができます。\n図 2. Transformer Engine を BF16 と FP8 のハイブリッドで使用した場合の学習スループット (TFLOP\/s)\nBF16 + Transformer Engine で学習を開始し、その後 FP8 ハイブリッドに切り替えた理由は、BF16 と FP8 でどの程度の tokens\/sec の性能差があるかを見るためだけでなく、初期学習をより安定させるためでもあります。学習の初期段階では、ウォームアップにより学習率 (LR) が上昇し、学習が不安定になります。そこで、初期学習は BF16 で行い、学習損失の値、オプティマイザーの状態、勾配ノルムなどに問題がないことを確認した後、FP8 に切り替えて学習を高速化することにしました。FP8 ハイブリッドにより学習速度が向上していることが分かります。\n私たちは、最終的に Megatron-LM を用いて 545-553TFLOP\/s の性能を達成できることを確認しました。以下は、LLM-jp 172B モデル学習の本実験と予備実験の結果に基づく、弱スケーリング性能のグラフです。このグラフでは、Y 軸が Aggregate Throughput を表し、X 軸が学習に使用した GPU の数を表しています。Llama2 7B、Llama2 13B、LLM-jp 172B の学習結果は、線形スケーリングを示していることが分かります。\n図 3. LLM-jp 172B モデル実験の弱スケーリング性能\nまとめ\n前述の通り、LLM-jp 172B の学習は現在も Megatron-LM を用いて進行中です。現在のチェックポイント データを用いた下流タスクの評価結果から、現状でも既に優れた日本語能力を獲得していると推察されますが、完全なモデルは来年の初めに完成予定です。\n膨大なデータセットを必要とする大規模言語モデルの事前学習において、学習時間はしばしば大きな課題となります。そのため、Megatron-LM のような効率的に学習可能なフレームワークは、生成 AI の研究開発を加速させる為に非常に重要です。\nMegatron-LM\nで学習した 172B モデルにおいて、FP8-hybrid 学習が学習速度を向上させる効果的な手法であることを実証し、1.4 倍の高速化 (400 TFLOP\/s → 550 TFLOP\/s) を達成しました。この結果は、FP8-hybrid が大規模モデルの事前学習の効率を向上させる有用なアプローチであることを強調しています。"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/5x-faster-time-to-first-token-with-nvidia-tensorrt-llm-kv-cache-early-reuse\/","en_title":"5x Faster Time to First Token with NVIDIA TensorRT-LLM KV Cache Early Reuse","en_content":"In our previous\nblog post\n, we demonstrated how reusing the key-value (KV) cache by offloading it to CPU memory can accelerate time to first token (TTFT) by up to 14x on x86-based NVIDIA H100 Tensor Core GPUs and 28x on the NVIDIA GH200 Superchip. In this post, we shed light on KV cache reuse techniques and best practices that can drive even further TTFT speedups.\nIntroduction to KV cache\nLLM models are rapidly being adopted for many tasks, including question-answering, and code generation. To generate a response, these models begin by converting the user’s prompt into tokens, which are then transformed into dense vectors. Extensive dot-product operations follow to mathematically model the relationships between the tokens and build a contextual understanding of the user input. The computational cost of generating this contextual understanding increases quadratically with the length of the input sequence.\nThis resource-intensive process generates keys and values, which are cached to avoid recomputation when generating subsequent tokens. Reusing the KV cache reduces the computational load and time needed to generate additional tokens—leading to a faster and more efficient user experience.\nWhen reusing the KV cache, careful attention must be given to how long it remains in memory, which components to evict first when memory is full, and when it can be reused for new incoming prompts. Optimizing these factors can lead to incremental performance improvements in KV cache reuse. NVIDIA TensorRT-LLM offers three key features that specifically address these areas.\nEarly KV cache reuse\nTraditional reuse algorithms require the entire KV cache computation to be completed before any portions of it can be reused with new user prompts. In scenarios such as enterprise chatbots, where system prompts—predefined instructions added to user queries—are essential to direct the LLM’s responses in line with enterprise guidelines, this method can be inefficient.\nWhen a surge of users interacts with the chatbot simultaneously, each user would require a separate computation of the system prompt KV cache. With TensorRT-LLM, we can instead reuse the system prompt as it is being generated in real time, enabling it to be shared across all users during the burst, rather than recalculating it for each user. This can significantly accelerate inference for use cases requiring system prompts by up to 5x.\nFigure 1. TensorRT-LLM KV cache reuse can speed up TTFT by up to 5x\nFlexible KV cache block sizing\nIn reuse implementations, only entire cache memory blocks can be allocated for reuse. For example, if the cache memory block size is 64 tokens and KV cache is 80 tokens, only 64 tokens will be stored for reuse, while the remaining 16 tokens will need to be recomputed. However, if the memory block size is reduced to 16 tokens, all 64 tokens can be stored across five memory blocks, eliminating the need for re-computation.\nThis effect is most pronounced when the input sequences are short. For long input sequences, larger blocks can be more beneficial.  As is clear, the more granular the control you have over the KV cache, the better you can optimize it for your specific use case.\nTensorRT-LLM provides fine-grained control over KV cache memory blocks, giving developers the ability to chop them into smaller blocks between 64 to 2 tokens. This optimizes the usage of allocated memory, increases reuse rates, and improves TTFT. When running LLAMA70B on NVIDIA H100 Tensor Core GPUs, we can speed up TTFT up to 7% in multi-user environments by reducing KV cache block size from 64 tokens to 8 tokens.\nFigure 2. Impact of changing KV cache block size on inference speedup\nEfficient KV cache eviction protocols\nPartitioning the KV cache into smaller blocks and evicting unused ones can be effective for memory optimization, but it introduces dependency complexities. When a specific block is used to generate a response, and the result is stored as a new block, it can form a tree-like structure of dependencies.\nOver time, the counters tracking the usage of the source blocks (the branches) may become stale as the dependent nodes (the leaves) are reused. Evicting the source block then requires the eviction of all dependent blocks, which would require recalculation of the KV cache for new user prompts, increasing TTFT.\nTo address this challenge, TensorRT-LLM includes intelligent eviction algorithms that can trace the dependent nodes from their source nodes and evict dependent nodes first, even if they have more recent reuse counters. This ensures more efficient memory management while preventing unnecessary evictions of dependent blocks.\nFigure 3. A logical representation of KV cache eviction algorithm show how it can reduce the number of evicted blocks, increasing the likelihood of reuse\nGetting started with TensorRT-LLM KV cache reuse\nGenerating KV cache during inference requires a lot of compute and memory resources. Using it efficiently is critical to improving model response, accelerating inference, and increasing system throughput. TensorRT-LLM provides advanced reuse features for developers looking to further optimize TTFT response times for peak performance.\nTo start using TensorRT-LLM KV cache reuse check out our\nGitHub documentation\n.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/5x-faster-time-to-first-token-with-nvidia-tensorrt-llm-kv-cache-early-reuse\/","jp_title":"NVIDIA TensorRT-LLM の KV Cache Early Reuseで、Time to First Token を 5 倍高速化","jp_content":"Reading Time:\n2\nminutes\n以前の\nブログ記事\nでは、key-value (KV) キャッシュを CPU メモリにオフロードして再利用することで、最初のトークンが出力されるまでの時間 (TTFT: Time To First Token) を x86 ベースの NVIDIA H100 Tensor コア GPU で最大 14 倍、NVIDIA GH200 Superchip で最大 28 倍に高速化できる方法をご紹介しました。本記事では、KV キャッシュの再利用技術と、TTFT のさらなる高速化を実現するベストプラクティスについて解説します。\nKV キャッシュの概要\nLLM モデルは、質問回答やコード生成など、多くのタスクで急速に採用されています。応答を生成するにあたり、これらのモデルはまず、ユーザーのプロンプトをトークンへ変換し、その後これらのトークンを密ベクトルへと変換します。膨大なドット積演算がその後に続き、その後トークン間の関係性を数学的にモデル化し、ユーザー入力に対する文脈理解を構築します。この文脈理解を生成するためにかかる計算コストは、入力シーケンスの長さの二乗に比例して増加します。\nこのリソースを大量に消費するプロセスから key とvalue が生成され、後続のトークンを生成するときに再度計算されないようにキャッシュされます。KV キャッシュを再利用することで、追加のトークンを生成する際に必要となる計算負荷と時間が軽減され、より高速で効率的なユーザー体験を実現します。\nKV キャッシュを再利用するときには、キャッシュがメモリに残る期間、メモリが一杯になったときに最初に削除するコンポーネント、および新しい入力プロンプトに再利用できるタイミングなどの点に細心の注意を払う必要があります。これらの要因を最適化することで、KV キャッシュの再利用におけるパフォーマンスの段階的な増加へとつなげることができます。NVIDIA TensorRT-LLM は、これらの分野に特化した 3 つの主要な機能を提供します。\nEarly KV cache reuse\n従来の再利用アルゴリズムでは、KV キャッシュをその一部であっても新しいユーザー プロンプトで再利用するためには、事前にすべての KV キャッシュの計算を完了させておく必要がありました。この方法は、LLM のレスポンスを企業のガイドラインに沿ったものにするために、システム プロンプト (ユーザーの問い合わせに追加される事前定義の指示) が不可欠となる企業向けチャットボットなどのシナリオでは、非効率的である可能性があります。\nチャットボットと同時にやり取りするユーザーが急増した場合、各ユーザーに対してシステム プロンプト KV キャッシュを個別に計算する必要があります。TensorRT-LLM では、リアルタイムで生成されるシステム プロンプトを再利用することができるため、急増時にはすべてのユーザーと共有することができ、ユーザーごとに再計算する必要がありません。これにより、システム プロンプトを必要とするユース ケースの推論を最大 5 倍にまで高速化することができます。\n図 1. TensorRT-LLM KV cache reuse により、TTFT を最大 5 倍高速化\n柔軟な KV キャッシュ ブロック サイズ\n再利用を実装する際には、キャッシュ メモリ ブロック全体のみを再利用に割り当てることができます。例えば、キャッシュ メモリ ブロック サイズが 64 トークンで、KV キャッシュが 80 トークンである場合、再利用のために保存できるのは 64 トークンのみであり、残りの 16 トークンは再計算する必要があります。しかしながら、メモリ ブロック サイズを 16 トークンに減らすと、64 トークンすべてを 5 つのメモリ ブロックに格納することができ、再計算の必要性がなくなります。\nこの効果は、入力シーケンスが短いときに最も顕著に現れます。長い入力シーケンスの場合は、より大きなブロックの方がより有益です。明らかに、KV キャッシュをより細かく制御できればできるほど、特定のユース ケースに合わせた最適化も向上します。\nTensorRT-LLM では、KV キャッシュ メモリ ブロックをきめ細かく制御できるため、開発者は KV キャッシュ メモリ ブロックを 64 から 2 トークンまで、より小さなブロックに分割することができます。これにより、割り当てられたメモリの使用が最適化され、再利用率が上昇し、TTFT が改善されます。NVIDIA H100 Tensor コア GPU で LLAMA70B を実行する場合、KV キャッシュ ブロックサイズを 64 トークンから 8 トークンへと減らすことで、マルチユーザー環境で TTFT を最大 7% 高速化できます。\n図 2. KV キャッシュ ブロック サイズの変更による推論の高速化\n効率的な KV キャッシュの除外 (Eviction) プロトコル\nKV キャッシュをより小さなブロックに分割し、未使用のブロックを除外することは、メモリの最適化に効果的ですが、依存関係に複雑さが生まれます。特定のブロックがレスポンスの生成に使用され、その結果が新しいブロックとして保存されると、依存関係のツリー構造が形成される可能性があります。\n時間の経過とともに、ソース ブロック (ブランチ) の使用を追跡するカウンターは、従属ノード (リーフ) が再利用されるにつれて古くなる可能性があります。ソース ブロック��除外するには、従属するすべてのブロックを除外する必要があり、新しいユーザ プロンプトの KV キャッシュを再計算する必要が生じて TTFT が増加します。\nこの課題に対処するために、TensorRT-LLM には、従属ノードをソース ノードから追跡し、従属ノードがより最近の再利用カウンターを持っている場合でも、最初に従属ノードを除外することができるインテリジェントな除外アルゴリズムが含まれています。これにより、より効率的にメモリを管理できるようになると共に、従属ブロックの不要な除外を回避できます。\n図 3. KV キャッシュの除外アルゴリズムの論理を表現した図。除外されるブロックの数を減らし、再利用の可能性を高められる様子を示しています。\nTensorRT-LLM KV cache reuse を使い始める\n推論中に KV キャッシュを生成するには、多くの計算とメモリ ソースが必要になります。効率的に使用することが、モデル応答の改善、推論の高速化、システム スループットの向上には不可欠です。TensorRT-LLM は、ピーク性能のために TTFT 応答時間をさらに最適化しようとする開発者に高度な再利用機能を提供します。\nTensorRT-LLM KV cache reuse を使い始めるには、\nGitHub のドキュメント\nを参照してください。\n関連情報\nGTC セッション:\nSpeeding up LLM Inference With TensorRT-LLM (TensorRT-LLM による LLM 推論の高速化)\nGTC セッション:\nOptimizing and Scaling LLMs With TensorRT-LLM for Text Generation (テキスト生成のための TensorRT-LLM を使用した LLM の最適化とスケーリング)\nSDK:\nTorch-TensorRT\nSDK:\nTensorRT\nSDK:\nTensorFlow-TensorRT"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/state-of-the-art-multimodal-generative-ai-model-development-with-nvidia-nemo\/","en_title":"State-of-the-Art Multimodal Generative AI Model Development with NVIDIA NeMo","en_content":"Generative AI\nhas rapidly evolved from text-based models to multimodal capabilities. These models perform tasks like image captioning and visual question answering, reflecting a shift toward more human-like AI. The community is now expanding from text and images to video, opening new possibilities across industries.\nVideo AI models are poised to revolutionize industries such as robotics, automotive, and retail. In\nrobotics\n, they enhance autonomous navigation in complex, ever-changing environments, which is vital for sectors like manufacturing and warehouse management. In the automotive industry, video AI is propelling autonomous driving, boosting vehicle perception, safety, and predictive maintenance to improve efficiency.\nTo build image and video foundation models, developers must curate and preprocess a large amount of training data, tokenize the resulting high-quality data at high fidelity, train or customize pretrained models efficiently and at scale, and then generate high-quality images and videos during inference.\nAnnouncing NVIDIA NeMo for multimodal generative AI\nNVIDIA NeMo\nis an end-to-end platform for developing, customizing, and deploying generative AI models.\nNVIDIA just announced the expansion of NeMo to support the end-to-end pipeline for developing multimodal models. NeMo enables you to easily curate high-quality visual data, accelerate\ntraining\nand\ncustomization\nwith highly efficient tokenizers and parallelism techniques, and reconstruct high-quality visuals during inference.\nAccelerated video and image data curation\nHigh-quality training data ensures high-accuracy results from an AI model. However, developers face various challenges in building data processing pipelines, ranging from scaling to data orchestration.\nNeMo Curator\nstreamlines the data curation process, making it easier and faster for you to build multimodal generative AI models. Its out-of-the-box experience minimizes the total cost of ownership (TCO) and accelerates time-to-market.\nWhile working with visuals, organizations can easily reach petabyte-scale data processing. NeMo Curator provides an orchestration pipeline that can load balance on multiple GPUs at each stage of the data curation. As a result, you can reduce video processing time by 7x compared to a naive GPU-based implementation. The scalable pipelines can efficiently process over 100 PB of data, ensuring the seamless handling of large datasets.\nFigure 1. NVIDIA NeMo Curator video processing speed\nNeMo Curator provides reference video curation models optimized for high-throughput filtering, captioning, and embedding stages to enhance dataset quality, empowering you to create more accurate AI models.\nFor instance, NeMo Curator uses an optimized captioning model that delivers an order of magnitude throughput improvement compared to unoptimized inference model implementations.\nNVIDIA Cosmos tokenizers\nTokenizers map redundant and implicit visual data into compact and semantic tokens, enabling efficient training of large-scale generative models and democratizing their inference on limited computational resources.\nToday’s open video and image tokenizers often generate poor data representations, leading to lossy reconstructions, distorted images, and temporally unstable videos and placing a cap on the capability of generative models built on top of the tokenizers. Inefficient tokenization processes also result in slow encoding and decoding and longer training and inference times, negatively impacting both developer productivity and the user experience.\nNVIDIA Cosmos tokenizers are open models that offer superior visual tokenization with exceptionally large compression rates and cutting-edge reconstruction quality across diverse image and video categories.\nVideo 1. Efficient Generative AI Tokenizers for Image and Video\nThese tokenizers provide ease of use through a suite of tokenizer standardized models that support vision-language models (VLMs) with discrete latent codes, diffusion models with continuous latent embeddings, and various aspect ratios and resolutions, enabling the efficient management of large-resolution images and videos. This provides you with tools for tokenizing a wide variety of visual input data to build image and video AI models.\nCosmos tokenizer architecture\nA Cosmos tokenizer uses a sophisticated encoder-decoder structure designed for high efficiency and effective learning. At its core, it employs 3D\ncausal convolution blocks\n, which are specialized layers that jointly process spatiotemporal information, and uses causal temporal attention that captures long-range dependencies in data.\nThe causal structure ensures that the model uses only past and present frames when performing tokenization, avoiding future frames. This is crucial for aligning with the causal nature of many real-world systems, such as those in physical AI or multimodal LLMs.\nFigure 2. NVIDIA Cosmos tokenizer architecture\nThe input is downsampled using 3D wavelets, a signal processing technique that represents pixel information more efficiently. After the data is processed, an inverse wavelet transform reconstructs the original input.\nThis approach improves learning efficiency, enabling the tokenizer encoder-decoder learnable modules to focus on meaningful features rather than redundant pixel details. The combination of such techniques and its unique training recipe makes the Cosmos tokenizers a cutting-edge architecture for efficient and powerful tokenization.\nDuring inference, the Cosmos tokenizers significantly reduce the cost of running the model by delivering up to 12x faster reconstruction compared to leading open-weight tokenizers (Figure 3).\nFigure 3. Quantitative comparison of reconstruction quality (left) and runtime performance (right) for video tokenizers\nThe Cosmos tokenizers also produce high-fidelity images and videos while compressing more than other tokenizers, demonstrating an unprecedented quality-compression trade-off.\nFigure 4. Continuous tokenizer compression rate compared to reconstruction quality\nFigure 5. Discrete tokenizer compression rate compared to reconstruction quality\nAlthough the Cosmos tokenizer regenerates from highly compressed tokens, it is capable of creating high-quality images and videos due to an innovative neural network training technique and architecture.\nFigure 6. Reconstructed video frame for continuous video tokenizers\nBuild Your Own Multimodal Models with NeMo\nThe expansion of the NVIDIA NeMo platform with at-scale data processing using\nNeMo Curator\nand high-quality tokenization and visual reconstruction using the Cosmos tokenizer empowers you to build state-of-the-art multimodal, generative AI models.\nJoin the waitlist\nand be notified when NeMo Curator is available. The tokenizer is available now on the\n\/NVIDIA\/cosmos-tokenizer\nGitHub repo and\nHugging Face\n.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/state-of-the-art-multimodal-generative-ai-model-development-with-nvidia-nemo\/","jp_title":"NVIDIA NeMo による最先端のマルチモーダル生成 AI モデル開発","jp_content":"Reading Time:\n2\nminutes\n生成 AI\nは、テキストベースのモデルからマルチモーダル機能へと急速に進化しています。これらのモデルは、画像のキャプション作成や視覚的な質問回答などのタスクを実行し、より人間に近い AI へとシフトしていることを反映しています。このコミュニティは現在、テキストや画像から動画へと拡大しており、さまざまな業界で新たな可能性を切り開かれています。\n動画 AI モデルは、ロボティクス、自動車、小売などの業界に革命を起こそうとしています。\nロボティクス\nでは、製造業や倉庫管理などの分野に不可欠な、複雑で変化し続ける環境における自律的なナビゲーションを強化しています。自動車業界では、動画 AI が自動運転を推進し、車両の認識、安全性、予知保全を強��し、効率性を高めています。\n画像や動画の基盤モデルを構築するには、開発者は大量の学習データのキュレーションと事前処理を行い、結果として得られた高品質データを高い忠実度でトークン化し、学習済みモデルを効率的に大規模に学習またはカスタマイズして、推論中に高品質な画像や動画を生成する必要があります。\nマルチモーダル生成 AI 向けの NVIDIA NeMo を発表\nNVIDIA NeMo\nは、生成 AI モデルを開発、カスタマイズ、デプロイするエンドツーエンドのプラットフォームです。\nNVIDIA は、マルチモーダル モデル開発向けのエンドツーエンドのパイプラインをサポートする NeMo の拡張を発表しました。NeMo により、高品質な視覚データを簡単にキュレーションし、高効率なトークナイザーと並列処理技術で\n学習\nと\nカスタマイズ\nを加速し、推論中に高品質なビジュアルを再構築することができます。\n動画と画像データのキュレーションを加速\n高品質な学習データでは、AI モデルから高精度な結果が得られます。しかし、開発者は、データ処理パイプラインの構築において、スケーリングからデータのオーケストレーションまで、さまざまな課題に直面しています。\nNeMo Curator\nは、データ キュレーション プロセスを合理化することで、マルチモーダル生成 AI モデルをより簡単かつ迅速に構築することができます。すぐに試すことができるため、総保有コスト (TCO) を最小限に抑え、市場投入までの時間を短縮します。\nビジュアルを扱う際には、組織はペタバイト規模のデータ処理を容易に実行できます。NeMo Curator は、データ キュレーションの各段階で複数の GPU に負荷分散できるオーケストレーション パイプラインを提供します。その結果、単純な GPU ベースの実装と比較して、動画処理時間を 7 分の 1 に短縮できます。スケール可能なパイプラインは、100 PB を超えるデータを効率的に処理でき、大規模なデータセットをシームレスに取り扱うことができます。\n図 1. NVIDIA NeMo Curator の動画処理速度\nNeMo Curator は、高いスループットのフィルタリング、キャプション作成、埋め込みの各段階に最適化されたリファレンス ビデオ キュレーション モデルを提供し、データセットの品質を向上させ、より正確な AI モデルの作成をサポートします。\nたとえば、NeMo Curator は、最適化されたキャプション モデルを使用し、最適化されていない推論モデルの実装と比較して、桁違いのスループットの向上を実現します。\nNVIDIA Cosmos トークナイザー\nトークナイザーは、冗長的で暗黙的な視覚データをコンパクトで意味のあるトークンにマッピングし、大規模な生成モデルの効率的な学習を実現し、誰もが限られた計算リソースで推論できるようにします。\n今日のオープンな動画や画像のトークナイザーは、データ表現が不十分なことが多いため、劣化の多い再構築、歪んだ画像、不連続な動画につながり、トークナイザー上に構築された生成モデルの能力に限界をもたらします。トークン化プロセスが非効率なため、エンコードやデコードに時間がかかり、学習や推論の時間が長くなり、開発者の生産性とユーザー体験の両方に悪影響を及ぼします。\nNVIDIA Cosmos トークナイザーは、優れた視覚トークン化を提供するオープンなモデルで、さまざまな画像や動画のカテゴリーで、高い圧縮率と最先端の再構築品質を実現します。\n離散的な潜在コードを備えた視覚言語モデル (VLM: Vision-language Model)、連続した潜在的埋め込みによる拡散モデル、さまざまなアスペクト比や解像度をサポートする一連のトークナイザー標準化モデルを使用して、これらのトークナイザーを簡単に使用でき、高解像度の画像や動画を効率的に管理することができます。これにより、画像や動画 AI モデルを構築するために、幅広い視覚入力データをトークン化するツールが提供されます。\nCosmos トークナイザーのアーキテクチャ\nCosmos トークナイザーは、高効率かつ効果的な学習向けに設計されており、高度なエンコーダー \/ デコーダー構造を使用しています。その中核には 3D\nCausal Convolution Block\n(因果畳み込みブロック) を採用しています。これは時空間情報を共同処理する特殊なレイヤーで、データの長期的���依存関係を捉える Causal Temporal Attention (因果的時間注意機構) を使用しています。\nこの因果構造により、トークン化の実行時にモデルが過去と現在のフレームのみを使用し、未来のフレームは使用しません。これは、物理的なAIやマルチモーダルLLMなどの多くの現実世界のシステムの因果性に合わせるために重要です。\n図 2. NVIDIA Cosmos トークナイザーのアーキテクチャ\n入力は、ピクセル情報をより効率的に表す信号処理技術である 3D ウェーブレットを使用してダウンサンプリングされます。データ処理後、逆ウェーベレット変換によって元の入力が再構築されます。\nこのアプローチにより、学習効率が向上し、トークナイザーのエンコーダー \/ デコーダーの学習可能なモジュールは、冗長なピクセルの詳細ではなく、意味のある特徴に焦点を当てることができます。このような技術と独自の学習レシピの組み合わせにより、Cosmos トークナイザーは、効率的かつ強力なトークン化を実現する最先端のアーキテクチャとなっています。\n推論の際、Cosmos トークナイザーは、主要なオープンウェイトのトークナイザーと比較して最大 12 倍高速な再構築を実現し、モデルの実行コストを大幅に削減しました (図 3)。\n図 3. Cosmos トークナイザーと主要なオープンウェイトのトークナイザーとの比較\nCosmos トークナイザーは、他のトークナイザーよりも高い圧縮率を実現しながら、高い忠実度の画像や動画を生成し、前例のない品質と圧縮のトレードオフを実現しています。\n図 4. 連続トークナイザーの圧縮率と再構築品質の比較\n図 5. 離散トークナイザーの圧縮率と再構築品質の比較\nCosmos トークナイザーは、高度に圧縮されたトークンから再生成されますが、革新的なニューラル ネットワークの学習技術とアーキテクチャにより、高品質な画像や動画を作成することができます。\n図 6. 連続動画トークナイザーで再構築された動画フレーム\nNeMo で独自のマルチモーダル モデルを構築\nNeMo Curator\nを使用した大規模なデータ処理と、Cosmos トークナイザーを使用した高品質なトークン化やビジュアル再構築を備えた、NVIDIA NeMo プラットフォームの拡張により、最先端のマルチモーダル生成 AI モデルを構築することができます。\n登録\nしていただくと、NeMo Curator が利用可能になった際に通知を受け取ることができます。トークナイザーは、現在\n\/NVIDIA\/cosmos-tokenizer\nGitHub リポジトリおよび\nHugging Face\nで利用することができます。\n関連情報\nGTC セッション:\nLarge Language Model Fine-Tuning using Parameter Efficient Fine-Tuning (PEFT を使用した大規模言語モデルのファインチューニング)\nGTC セッション:\nLarge Language Model Fine-Tuning using NVIDIA NeMo (NVIDIA NeMo を使用した大規模言語モデルのファインチューニング – Domino Data Lab 提供)\nSDK:\nNVIDIA NeMo カスタマイザー\nSDK:\nNeMo LLM サービス\nSDK:\nNeMo Megatron"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/frictionless-collaboration-and-rapid-prototyping-in-hybrid-environments-with-nvidia-ai-workbench\/","en_title":"Frictionless Collaboration and Rapid Prototyping in Hybrid Environments with NVIDIA AI Workbench","en_content":"NVIDIA AI Workbench\nis a free development environment manager that streamlines data science, AI, and machine learning (ML) projects on systems of choice. The goal is to provide a frictionless way to create, compute, and collaborate on and across PCs, workstations, data centers, and clouds. The basic user experience is straightforward:\nEasy setup on single systems:\nClick through install in minutes on Windows, Ubuntu, and macOS, with a one-line install on remote systems.\nManaged experience for decentralized deployment\n: A free, PaaS\/SaaS type UX in truly hybrid contexts with no need for a centralized, service-based platform.\nSeamless collaboration for experts and beginners:\nFriendly Git, container, and application management without limiting customization by power users.\nConsistent across users and systems:\nMigrate workloads and applications across different systems while maintaining functionality and user experience.\nSimplified GPU handling\n: Handles system dependencies like\nNVIDIA drivers\nand the\nNVIDIA Container Toolkit\n, as well as\nGPU-enabled container\nruntime configuration.\nThis post explores highlights of the October release of NVIDIA AI Workbench, which is the most significant since the product launch at GTC 2024 and is a big step closer to the full product vision.\nRelease highlights\nThis section will detail the major new capabilities and user-requested updates in the latest release.\nMajor new capabilities include:\nEnhance collaboration through expanded Git support, such as branching, merging, diffs, and finer-grained control for commits and gitignore.\nCreate complex applications and workflows with multicontainer environments through Docker Compose support.\nSimple, fast, and secure rapid prototyping with application sharing with single-user URLs.\nUser requested updates:\nDark mode for the Desktop App\nImproved installation on localized versions of Windows\nExpanded Git support\nPreviously, AI Workbench supported only single, monolithic commits on the main branch. Users had to manage branches and merges manually, and this created various types of confusion, especially around resolving merge conflicts. Now, users can manage branches, merges, and conflicts directly in the Desktop App and the CLI. In addition, they can see and triage individual file diffs for commits. The UI is built to work seamlessly with manual Git operations and will update to reflect relevant changes.\nFigure 1. AI Workbench Desktop App tab for Git branching\nThese features are found in two new tabs on the Desktop App: Changes and Branches.\nChanges\n: Gives a line-by-line view of the diffs between the working tree and previous commits. Users can now select and commit file changes individually or in bulk based on visible file diffs tracked changes (addition, modification, or deletion), as well as being able to individually reject or add a file to git-ignore. The view also updates dynamically to reflect manual Git actions, for example manually staging a file and then following up with a change to the file in the working tree.\nBranches\n: Provides branch management, including creation, switching, and merging, as well as visibility for remote branches on a Git server. Merging branches with a conflict initiates a conflict resolution flow that users can do within the UI, or move to a terminal or file editor of their choice.\nLearn more about how these advanced Git features work\n.\nMulticontainer support with Docker Compose stacks\nAI Workbench now supports\nDocker Compose\n. Users can work with multicontainer applications and workflows with the same ease of configuration, reproducibility, and portability that AI Workbench provides for single-container environments.\nFigure 2. The Docker Compose feature in the AI Workbench Environment Management tab\nThe basic idea is to add a Docker Compose-based “stack” that is managed by AI Workbench and connects to the main development container. To add the stack, a user just needs to add the appropriate Docker Compose file to the project repository and do some configuration in the Desktop App or CLI.\nWe’re using Docker Compose for a few reasons. First, we didn’t want to develop in a vacuum, and that’s why we’ve been\ncollaborating with the Docker team\non features like a\nmanaged Docker Desktop install\n.\nSecond, we want users to be able to work with the multicontainer applications outside of AI Workbench, and Docker Compose is the easiest way to do that. The vision for this feature is to enable streamlined, powerful development and compute for multicontainer applications within AI Workbench that can then be stood up outside of AI Workbench with a simple\ndocker-compose\nup command.\nThis multicontainer feature is new and will continue to evolve. We would love to get feedback and help you sort out any issues through the\nNVIDIA AI Workbench Developer Forum\n.\nLearn more about how Docker Compose works\n.\nWeb application sharing through secure URLs\nAI Workbench enables users to easily spin up managed web applications that are built into a project. The process is fairly simple: create or clone a project with the web app installed, start the project, then start the app, and it appears in your browser.\nThis approach is great for a developer UX, but it wasn’t good for rapid prototyping UX and collaboration. If you wanted another user to access and test your application, you either asked them to install AI Workbench, clone the project and run it, or you had to fully extract the application to run it and make it available to the user. The first is a speed bump for the user, and the second is a speed bump for the developer.\nWe eliminated these speed bumps with a simple feature that enables you to set a remote AI Workbench to enable external access and to create single-use, secure URLs for running web applications in a project on that remote. You just need to make sure the user has access to port 10000 on the remote, and the application will be directly accessible. All they have to do is click the link and go to the app.\nFigure 3. Developers can now give end users direct access to applications running in an AI Workbench Project on a remote through secure, one-time-use URLs\nEnabling this kind of access is useful for rapid prototyping and collaboration. That’s why various SaaS offerings provide this as a managed service. The difference with AI Workbench is that you can provide this access on your own resources and in your own network, for example on data center resources or a shared server. It doesn’t have to be in the cloud.\nAI Workbench keeps things secure by restricting this access to a single browser and to a single application that’s running in the project. This means a user can’t share the URL with someone else, and they are constrained to the web app that you shared with them.\nLearn more about how application sharing works.\nDark mode and localized Windows installation\nMany users requested a dark mode option because it’s easier on the eyes. It’s now available and can be selected through the Settings window that is now available directly from within the Desktop App.\nLearn more about how dark mode works\n.\nWindows users are by far our main demographic for the local installs, and not all Windows users are using the English language pack, and this blocked AI Workbench install due to how we handled some WSL commands. In particular, we’ve had users working in Cyrillic or Chinese that were blocked on Windows. We adjusted how we handle non-English language packs, and it should work well now. If you were previously blocked by this, give it a try now. If it still doesn’t work for you, let us know in the\nNVIDIA AI Workbench Developer Forum\nso we can continue to improve this capability.\nNew AI Workbench projects\nThis release introduces new example projects designed to jumpstart your AI development journey, detailed below.  An\nAI Workbench project\nis a structured Git repository that defines a containerized development environment in AI Workbench. AI Workbench projects provide:\nEffortless setup and GPU configuration:\nSimply clone a project from GitHub or GitLab, and AI Workbench handles the rest with automatic GPU configuration.\nDevelopment integrations:\nSeamless support for popular development environments such as Jupyter and VS Code, as well as support for user-configured web applications.\nContainerized and customizable environments:\nProjects are containerized, isolated, and easily modifiable. Adapt example projects to suit your specific needs while ensuring consistency and reproducibility.\nExplore NVIDIA AI Workbench example projects\n.\nMultimodal virtual assistant\nexample project\nThis project enables users to build their own virtual assistant using a multimodal\nretrieval-augmented generation (RAG)\npipeline with fallback to web search. Users can interact with two RAG-based applications to learn more about AI Workbench, converse with the user documentation, troubleshoot their own installation, or even focus the RAG pipeline to their own, custom product.\nControl-Panel:\nCustomizable Gradio app for working with product documentation allows uploading webpages, PDFs, images, and videos to a persistent vector store and query them. For inference, users can select between cloud endpoints like on the NVIDIA API Catalog or use self-hosted endpoints to run their own inference.\nPublic-Chat:\nWith product documents loaded, the Gradio app is a simplified, “read-only” chatbot that you can share with end users through the new AI Workbench App Sharing feature.\nFigure 4. Using the Public-Chat web app, a read-only, pared down chat application that is meant to be more consumable and shareable to end users\nCompetition-Kernel example project\nThis project provides an easy, local experience when working on Kaggle competitions. You can easily leverage your local machine or a cloud instance to work on competition datasets, write code, build out models, and submit results, all through AI Workbench. The Competition Kernel project offers:\nA managed experience to develop and test on your own GPUs and set up and customize in minutes.\nEasy version control and tracking of code through GitHub or GitLab and very easy collaboration.\nThe power of using a local, dedicated IDE: robust debugging, intelligent code completion, extensive customization options.\nEasy plugin to existing data sources (external or your own).\nNo Internet? No problem. Develop while offline.\nGet started\nThis release of NVIDIA AI Workbench marks a significant step forward in providing a frictionless experience for AI development across GPU systems. New features from this release, including expanded Git support, support for multicontainer environments, and secure web app sharing, streamline developing and collaborating on AI workloads. Explore these features in the three new example projects available with this release or create your own projects.\nTo get started with AI Workbench,\ninstall the application from the webpage\n. For more information about installing and updating, see the\nNVIDIA AI Workbench documentation\n.\nExplore a range of\nNVIDIA AI Workbench example projects\n, from data science to RAG.\nVisit the\nNVIDIA AI Workbench Developer Forum\nto report issues and learn more about how other developers are using AI Workbench.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/frictionless-collaboration-and-rapid-prototyping-in-hybrid-environments-with-nvidia-ai-workbench\/","jp_title":"NVIDIA AI Workbench によるハイブリッド環境におけ��スムーズなコラボレーションと迅速なプロトタイピング","jp_content":"Reading Time:\n3\nminutes\nNVIDIA AI Workbench\nは、選択したシステムでデータ サイエンス、AI、機械学習 (ML) プロジェクトを合理化する無料の開発環境マネージャーです。 PC、ワークステーション、データ センター、クラウド上で、あるいはそれらをまたがり、スムーズな作成、計算、コラボレーションを行うことを目的としています。基本的なユーザー体験はシンプルです:\n単一システムで簡単なセットアップ:\nWindows、Ubuntu、macOS ではクリック操作でインストールが完了し、リモート システムでは 1 行のコマンドでインストールすることができます。\n分散型デプロイのための管理化された体験\n: 集中型のサービスベースのプラットフォームを必要としない、本当の意味でハイブリッドなコンテキストにおける無料の PaaS\/SaaS 型のユーザー体験。\nエキスパートと初心者向けのシームレスなコラボレーション:\nパワー ユーザーによるカスタマイズを制限することのない、使いやすい Git、コンテナー、アプリケーション管理。\nユーザーとシステム間の一貫性:\n機能とユーザー体験を維持しながら、異なるシステム間でワークロードとアプリケーションを移行。\nGPU 処理の簡素化\n:\nNVIDIA ドライバー\nや\nNVIDIA コンテナー ツールキット\nなどのシステム依存関係、\nおよび GPU 対応のコンテナー\nランタイム構成を処理。\nこの記事では、GTC 2024 での製品発表以来、最も重要な NVIDIA AI Workbench の 10 月のリリースにおけるハイライトをご紹介します。製品ビジョン実現に向けた大きな一歩です。\nリリース ハイライト\nこのセクションでは、最新リリースでの主要な新機能とユーザーから要望のあった更新について、詳しく説明します。\n主な新機能には以下が含まれます。\nブランチ、マージ、差分、コミットと gitignore の細かい制御など、Git のサポートを拡大し、コラボレーションを強化します。\nDocker Compose のサポートを通じて、マルチコンテナー環境で複雑なアプリケーションとワークフローを作成します。\nシングルユーザー URL でアプリケーションを共有することで、シンプルかつ迅速、安全なプロトタイピングを実現します。\nユーザーの要望によるアップデート:\nデスクトップ アプリのダークモード\nローカライズ版 Windows のインストール改善\nGit サポートの拡張\nこれまで AI Workbench は、メイン ブランチでの単一のモノリシックなコミットのみをサポートしていました。 ユーザーはブランチとマージを手動で管理する必要があり、特にマージの競合の解決に関して、さまざまな種類の混乱が生じていました。 現在は、ブランチ、マージ、競合を、デスクトップ アプリと CLI で直接管理することができます。 加えて、コミットの個々のファイル差分を確認し、優先順位を付けることもできます。 この UI は、手動の Git 操作とシームレスに動作するように構築されており、関連する変更を反映して更新されます。\n図 1. Git ブランチ用の AI Workbench Desktop アプリ タブ\nこれらの機能は、デスクトップ アプリの 2 つの新しいタブ: [Changes (変更)] と [Branches (ブランチ)] に表示されます。\n変更\n: 作業ツリーと以前のコミット間の差分を 1 行ずつ表示します。 ユーザーは、表示されているファイル差分、追跡された変更 (追加、修正、削除) に基づいて、ファイル変更を個別または一括で選択し、コミットすることができるようになりました。また、git-ignore にファイルを個別に拒否、または追加することもできます。 このビューはまた、手動の Git 操作を反映するように動的に更新されます。例えば、ファイルを手動でステージングし、作業ツリー内のファイルに変更を加えます。\nブランチ\n: Git サーバー上のリモート ブランチを可視化するだけでなく、作成、切り替え、マージなどのブランチ管理を提供します。競合のあるブランチをマージすると、競合解決フローが開始されます。このフローは、ユーザーが UI 内で実行することも、選択した端末やファイル エディターに移動することもできます。\nこれらの高度な Git 機能の仕組みの詳細をご覧ください\n。\nDocker Compose スタックによるマルチコンテナーのサポート\nAI Workbench が���\nDocker Compose\nをサポートするようになりました。 ユーザーは、AI Workbench がシングルコンテナー環境向けに提供する構成、再現性、移植性と同様の容易さで、マルチコンテナー アプリケーションとワークフローを操作することができます。\n図 2. AI Workbench 環境管理タブの Docker Compose 機能\n基本的な考え方は、AI Workbench によって管理され、メインの開発コンテナーに接続する Docker Compose ベースの「スタック」を追加することです。 スタックを追加するには、ユーザーは 適切な Docker Compose ファイルをプロジェクト リポジトリに追加し、デスクトップ アプリまたは CLI でいくつかの設定を行うだけです。\nNVIDIA では、いくつかの理由があって Docker Compose を使用しています。 1 つ目は、何もない所から開発を行うことを望んでいなかったからです。そのため、\n管理された Docker デスクトップ インストール\nなどの機能について\nDocker チームと協力\nしてきました。\n2 つ目は、AI Workbench の以外で、ユーザーがマルチコンテナー アプリケーションを操作できるようにするには、Docker Compose が最も簡単な方法だからです。この機能のビジョンは、AI Workbench 内のマルチコンテナー アプリケーションを合理化し、効果的な開発と演算処理を可能にし、シンプルな\ndocker-compose\nup コマンドで AI Workbench 外で起動できるようにすることです。\nこのマルチコンテナー機能は新しい機能であり、今後も進化し続けます。\nNVIDIA AI Workbench 開発者フォーラム\nを通じて、是非フィードバックをお寄せください。問題解決をお手伝いいたします。\nDocker Compose の仕組みの詳細をご覧ください\n。\nセキュアな URL によるウェブ アプリケーション共有\nAI Workbench により、ユーザーはプロジェクトに組み込まれた管理されたウェブ アプリケーションを簡単に起動することができます。 このプロセスは非常に簡単で、Web アプリがインストールされたプロジェクトを作成または複製し、プロジェクトを開始してからアプリを開始すると、ブラウザーに表示されます。\nこのアプローチは開発者の UX には最適ですが、迅速なプロトタイピングの UX やコラボレーションには適していませんでした。 他のユーザーにアプリケーションへのアクセスとテストを行ってもらう場合、AI Workbench のインストール、プロジェクトの複製、実行を依頼するか、アプリケーションを完全に抽出して実行し、ユーザーが利用できるようにする必要がありました。 1 つ目はユーザーの課題であり、2 つ目は開発者の課題です。\nNVIDIA では、リモートの AI Workbench を設定して外部からのアクセスを可能にし、そのリモート上のプロジェクトにおいて、ウェブ アプリケーションを実行するための一回限りの安全な URL を作成することができるシンプルな機能でこれらの課題を克服しました。 ユーザーがリモートのポート 10000 にアクセスできることを確認するだけで、アプリケーションに直接アクセスできるようになります。 リンクをクリックしてアプリに移動するだけです。\n図 3. 開発者は、一回限りの安全な URL を通じて、エンドユーザーを AI Workbench プロジェクトで実行しているアプリケーションに、リモートで直接アクセスさせることができるようになりました\nこのようなアクセスを有効にすることは、迅速なプロトタイピングとコラボレーションに役立ちます。 だからこそ、さまざまな SaaS がこれを提供するマネージド サービスとして提供しているのです。AI Workbench との違いは、データ センターのリソースや共有サーバーなど、独自のリソースや独自のネットワークで、このアクセスを提供できることです。 クラウドである必要はありません。\nAI Workbench は、単一のブラウザーとプロジェクトで実行されている単一のアプリケーションに対して、このアクセスを制限することで、安全性を確保します。 つまり、ユーザーは URL を他のユーザーと共有できず、共有したウェブ アプリに制限されます。\nアプリケーション共有の仕組みの詳細をご覧ください。\nダーク モードとローカライズされた Windows インストール\n多くのユーザーから、目に優しいダーク モードオプションの要望が寄せられました。 現在、このオプションは利用可能で、デスクトップ アプリから直接使用できる設定ウィンドウから選択できるようになっています。\nダーク モードの仕組みの詳細をご覧ください\n。\nローカル インストールの主なユーザー層は Windows ユーザーですが、すべての Windows ユーザーが英語パックを使用しているわけではありません。また、WSL コマンドの処理方法により、この AI Workbench のインストールがブロックされていました。 特に、Windows 上でキリル文字、または中国語で作業するユーザーがブロックされていました。 英語以外の言語パックを処理する方法を調整したので、現在は問題なく機能するはずです。 以前ブロックされていた場合は、是非お試しください。 それでも機能しない場合は、\nNVIDIA AI Workbench 開発者フォーラム\nでお知らせください。それにより NVIDIA は、引き続きこの機能を改善することができます。\n新しい AI Workbench プロジェクト\nこのリリースで、AI 開発をすぐに始められるように設計された新しいサンプル プロジェクトをご紹介します。詳細は以下をご覧ください。\nAI Workbench プロジェクト\nは、AI Workbench のコンテナー化された開発環境を定義する構造化された Git リポジトリです。 AI Workbench プロジェクトでは、以下を提供します。\n簡単なセットアップと GPU 構成:\nプロジェクトを GitHub または GitLab からクローンするだけで、残りは AI Workbench が自動で GPU 構成を行います。\n開発の統合:\nJupyter や VS Code などの一般的な開発環境に対してシームレスにサポートし、ユーザー構成のウェブ アプリケーションについてもサポートします。\nコンテナー化されたカスタマイズ可能な環境:\nプロジェクトはコンテナー化され、分離され、簡単に変更可能です。 一貫性と再現性を確保しながら、特定のニーズに合わせてサンプル プロジェクトを適合させることができます。\nNVIDIA AI Workbench サンプル プロジェクトをご覧ください\n。\nマルチモーダル仮想アシスタント サンプル プロジェクト\nこのプロジェクトでは、ウェブ検索へのフォールバックを伴うマルチモーダル\n検索拡張生成 (RAG)\nパイプラインを使用して、独自の仮想アシスタントをすることが構築できます。 ユーザーは、2 つの RAG ベースのアプリケーションを操作して、AI Workbench の詳細を学んだり、ユーザー ドキュメントを参照したり、自身のインストールのトラブルシューティングをしたり、あるいは RAG パイプラインを独自のカスタム製品に集中させたりすることができます。\nControl-Panel:\n製品のドキュメントを操作するためのカスタマイズ可能な Gradio アプリでは、ウェブページ、PDF、画像、動画を永続的なベクトル ストアにアップロードし、それらを問い合わせできます。 推論に関しては、NVIDIA API カタログのように、クラウド エンドポイントを選択したり、セルフホスト型のエンドポイントを使用して、独自の推論を実行できます。\nPublic-Chat:\n製品ドキュメントが読み込まれると、Gradio アプリは簡素化された「読み取り専用」チャットボットとなり、新しい AI Workbench アプリ共有機能を通じてエンド ユーザーと共有できます。\n図 4. Public-Chat ウェブ アプリは、読み取り専用のシンプルなチャット アプリケーションで、エンドユーザーの利用と共有を容易にします\nCompetition-Kernel サンプル プロジェクト\nこのプロジェクトは、Kaggle コンペティションに取り組む際に簡単なローカル エクスペリエンスを提供します。 AI Workbench を通じて、ローカル マシン、またはクラウド インスタンスを活用し、コンペティションのデータセット、コードの作成、モデルの構築、結果の提出などを簡単に実行することができます。 Competition Kernel プロジェクトでは、以下を提供します。\n独自の GPU で開発とテストを行い、数分でセットアップとカスタマイズを行う管理された体験。\nGitHub または GitLab によるコードのバージョン コントロールと追跡、コラボレーションが容易。\nローカルで専用 IDE を使用するパワー: 堅牢なデバッグ、インテリジェントなコード補完、広範なカスタマイズ オプション。\n既存のデータ ソース (外部または独自) への簡単なプラグイン。\nインターネットが使えない? 問題ありません。オフラインでも開発できます。\n今すぐ始���ましょう\nこの NVIDIA AI Workbench のリリースは、GPU システム全体で AI 開発に円滑な体験を提供する大きな一歩となります。 このリリースには、Git のサポートの拡張、マルチコンテナー環境のサポート、安全なウェブ アプリ共有など、AI ワークロードでの開発とコラボレーションの効率化などの新機能が含まれます。 このリリースで利用可能となった 3 つの新しいサンプル プロジェクトでこれらの機能をお試しいただくか、独自のプロジェクトを作成することもできます。\nAI Workbench を始めるには、\nウェブページからアプリケーションをインストールしてください\n。 インストールと更新の詳細については、\nNVIDIA AI Workbench のドキュメント\nを参照してください。\nデータ サイエンスから RAG まで、さまざまな\nNVIDIA AI Workbench のサンプル プロジェクト\nもご用意しています。\n問題を報告したり、他の開発者による AI Workbench の活用方法を確認するには、\nNVIDIA AI Workbench 開発者フォーラム\nにアクセスしてください。\n関連情報\nDLI コース:\n対話型 AI Building Conversational AI Applications (アプリケーションの構築 )\nGTC セッション:\nBreaking Barriers: How NVIDIA AI Workbench Makes AI Accessible to All (障壁の打破: NVIDIA AI Workbench による AI をすべての人々に身近にする方法)\nウェビナー:\nVirtual Desktop in the Era of AI (AI 時代の仮想デスクトップ)\nウェビナー:\nJumpstart AI Development With Virtual Workstations (仮想ワークステーションで AI 開発を加速)"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/build-multimodal-visual-ai-agents-powered-by-nvidia-nim\/","en_title":"Build Multimodal Visual AI Agents Powered by NVIDIA NIM","en_content":"The exponential growth of visual data—ranging from images to PDFs to streaming videos—has made manual review and analysis virtually impossible. Organizations are struggling to transform this data into actionable insights at scale, leading to missed opportunities and increased risks.\nTo solve this challenge, vision-language models (VLMs) are emerging as powerful tools, combining visual perception of images and videos with text-based reasoning. Unlike traditional\nlarge language models\n(LLMs) that only process text, VLMs empower you to build\nvisual AI agents\nthat understand and act on complex multimodal data, enabling real-time decision-making and automation.\nImagine having an intelligent AI agent that can analyze remote camera footage to detect early signs of wildfires or scan business documents to extract critical information buried within charts, tables, and images—all autonomously.\nWith\nNVIDIA NIM microservices\n, building these advanced visual AI agents is easier and more efficient than ever. Offering flexible customization, streamlined API integration, and smooth deployment, NIM microservices enable you to create dynamic agents tailored to your unique business needs.\nIn this post, we guide you through the process of designing and building intelligent visual AI agents using NVIDIA NIM microservices. We introduce the different types of vision AI models available, share four sample applications—streaming video alerts, structured text extraction, multimodal search, and few-shot classification—and provide Jupyter notebooks to get you started. For more information about bringing these models to life, see the\n\/NVIDIA\/metropolis-nim-workflows\nGitHub repo.\nTypes of vision AI models\nTo build a robust visual AI agent, you have the following core types of vision models at your disposal:\nVLMs\nEmbedding models\nComputer vision (CV) models\nThese models serve as essential building blocks for developing intelligent visual AI agents. While the VLM functions as the core engine of each agent, CV and embedding models can enhance its capabilities, whether by improving accuracy for tasks like object detection or parsing complex documents.\nIn this post, we use\nvision NIM microservices\nto access these models. Each vision NIM microservice can be easily integrated into your workflows through simple REST APIs, allowing for efficient model inference on text, images, and videos. To get started, you can experiment with hosted preview APIs on\nbuild.nvidia.com\n, without needing a local GPU.\nFigure 1.The llama-3.2-vision-90b model on build.nvidia.com\nVision language models\nVLMs bring a new dimension to language models by adding vision capabilities, making them multimodal. These models can process images, videos, and text, enabling them to interpret visual data and generate text-based outputs. VLMs are versatile and can be fine-tuned for specific use cases or prompted for tasks such as Q&A based on visual inputs.\nNVIDIA and its partners offer several VLMs as NIM microservices each differing in size, latency, and capabilities (Table 1).\nCompany\nModel\nSize\nDescription\nNVIDIA\nVILA\n40B\nA powerful general-purpose model built on SigLIP and Yi that is suitable for nearly any use case.\nNVIDIA\nNeva\n22B\nA medium-sized model combining NVGPT and CLIP and offering the functionality of much larger multimodal models.\nMeta\nLlama 3.2\n90B\/11B\nThe first vision-capable Llama model in two sizes, excelling in a range of vision-language tasks and supporting higher-resolution input.\nMicrosoft\nphi-3.5-vision\n4.2B\nA small, fast model that excels at OCR and is capable of processing multiple images.\nMicrosoft\nFlorence-2\n0.7B\nA multi-task model capable of captioning, object detection, and segmentation using simple text prompts.\nTable 1. VLM NIM microservices\nEmbedding models\nEmbedding models convert input data (such as images or text) into dense feature-rich vectors known as embeddings. These embeddings encapsulate the essential properties and relationships within the data, enabling tasks like similarity search or classification. Embeddings are typically stored in\nvector databases\nwhere GPU-accelerated search can quickly retrieve relevant data.\nEmbedding models play a crucial role in creating intelligent agents. For example, they support\nretrieval-augmented generation\n(RAG) workflows, enabling agents to pull relevant information from diverse data sources and improve accuracy through in-context learning.\nCompany\nModel\nDescription\nUse Cases\nNVIDIA\nNV-CLIP\nMultimodal foundation model generating text and image embeddings\nMultimodal search, Zero-shot classification\nNVIDIA\nNV-DINOv2\nVision foundation model generating high-resolution image embeddings\nSimilarity search, Few-shot classification\nTable 2.\nEmbedding NIM microservices\nComputer vision models\nCV models focus on specialized tasks like image classification, object detection, and optical character recognition (OCR). These models can augment VLMs by adding detailed metadata, improving the overall intelligence of AI agents.\nCompany\nModel\nDescription\nUse Cases\nNVIDIA\nGrounding Dino\nOpen-vocabulary object detection\nDetect anything\nNVIDIA\nOCDRNet\nOptical character detection and recognition\nDocument parsing\nNVIDIA\nChangeNet\nDetects pixel-level changes between two images\nDefect detection, satellite imagery analysis\nNVIDIA\nRetail Object Detection\nPretrained to detect common retail items\nLoss prevention\nTable 3.\nComputer vision NIM microservices\nBuild visual AI agents with vision NIM microservices\nHere are real-world examples of how the vision NIM microservices can be applied to create powerful visual AI agents.\nTo make application development with NVIDIA NIM microservices more accessible, we have published a collection of examples on GitHub. These examples demonstrate how to use NIM APIs to build or integrate them into your applications. Each example includes a Jupyter notebook tutorial and demo that can be easily launched, even without GPUs.\nOn the\nNVIDIA API Catalog\n, select a model page, such as\nLlama 3.1 405B\n. Choose\nGet API Key\nand\nenter your business email\nfor a 90-day\nNVIDIA AI Enterprise\nlicense, or use your personal email to\naccess NIM\nthrough the\nNVIDIA Developer Program\n.\nOn the\n\/NVIDIA\/metropolis-nim-workflows\nGitHub repo, explore the Jupyter notebook tutorials and demos. These workflows showcase how vision NIM microservices can be combined with other components, like vector databases and LLMs to build powerful AI agents that solve real-world problems. With your API key, you can easily recreate the workflows showcased in this post, giving you hands-on experience with Vision NIM microservices.\nHere are a few example workflows:\nVLM streaming video alerts agent\nStructured text extraction agent\nFew-shot classification with NV-DINOv2 agent\nMultimodal search with NV-CLIP agent\nVLM streaming video alerts agent\nWith vast amounts of video data generated every second, it’s impossible to manually review footage for key events like package deliveries, forest fires, or unauthorized access.\nThis workflow shows how to use VLMs, Python, and OpenCV to build an AI agent that\nautonomously monitors live streams for user-defined events\n. When an event is detected, an alert is generated, saving countless hours of manual video review. Thanks to the flexibility of VLMs, new events can be detected by changing the prompt—no need for custom CV models to be built and trained for each new scenario..\nVideo 1. Visual AI Agent Powered by NVIDIA NIM\nIn Figure 2, the VLM runs in the cloud while the video streaming pipeline operates locally. This setup enables the demo to run on almost any hardware, with the heavy computation offloaded to the cloud through NIM microservices.\nFigure 2. Streaming video alert agent architecture\nHere are the steps for building this agent:\nLoad and process the video stream\n: Use OpenCV to load a video stream or file, decode it, and subsample frames.\nCreate REST API endpoints:\nUse FastAPI to create control REST API endpoints where users can input custom prompts.\nIntegrate with the VLM API:\nA wrapper class handles interactions with the VLM API by sending video frames and user prompts. It forms the NIM API requests and parses the response.\nOverlay responses on video:\nThe VLM response is overlaid onto the input video, streamed out using OpenCV for real-time viewing.\nTrigger alerts:\nSend the parsed response over a WebSocket server to integrate with other services, triggering notifications based on detected events.\nFor more information about building a VLM-powered streaming video alert agent, see the\n\/NVIDIA\/metropolis-nim-workflows\nnotebook tutorial and demo on GitHub. You can experiment with different VLM NIM microservices to find the best model for your use case.\nFor more information about how VLMs can transform edge applications with\nNVIDIA Jetson\nand\nJetson Platform Services\n, see\nDevelop Generative AI-Powered Visual AI Agents for the Edge\nand explore additional resources on the\nJetson Platform Services\npage.\nStructured text extraction agent\nMany business documents are stored as images rather than searchable formats like PDFs. This presents a significant challenge when it comes to searching and processing these documents, often requiring manual review, tagging, and organizing.\nWhile optical character detection and recognition (OCDR) models have been around for a while, they often return cluttered results that fail to retain the original formatting or interpret its visual data. This becomes especially challenging when working with documents in irregular formats, such as photo IDs, which come in various shapes and sizes.\nTraditional CV models make processing such documents time-consuming and costly. However, by combining the flexibility of VLMs and LLMs with the precision of OCDR models, you can build a\npowerful text-extraction pipeline to autonomously parse documents\nand store user-defined fields in a database.\nFigure 3. Structured text extraction agent architecture\nHere are the structured text-extraction pipeline building steps:\nDocument input:\nProvide an image of the document to an OCDR model, such as OCDRNet or Florence, which returns metadata for all the detected characters in the document.\nVLM integration:\nThe VLM processes the user’s prompt specifying the desired fields and analyzes the document. It uses the detected characters from the OCDR model to generate a more accurate response.\nLLM formatting:\nThe response of the VLM is passed to an LLM, which formats the data into JSON, presenting it as a table.\nOutput and storage:\nThe extracted fields are now in a structured format, ready to be inserted into a database or stored for future use.\nFigure 4. Structured text extraction example with vision NIM microservices\nThe preview APIs make it easy to experiment by combining multiple models to build complex pipelines. From the demo UI, you can switch between different VLMs, OCDR, and LLM models available on\nbuild.nvidia.com\nfor quick experimentation.\nFew-shot classification with NV-DINOv2\nNV-DINOv2 generates embeddings from high-resolution images, making it ideal for tasks requiring detailed analysis, such as defect detection with only a few sample images. This workflow demonstrates how to build a\nscalable few-shot classification pipeline\nusing NV-DINOv2 and a Milvus vector database.\nFigure 5. Few-shot classification with NV-DINOv2\nHere is how the few-shot classification pipeline works:\nDefine classes and upload samples:\nUsers define classes and upload a few sample images for each. NV-DINOv2 generates embeddings from these images, which are then stored in a Milvus vector database along with the class labels.\nPredict new classes:\nWhen a new image is uploaded, NV-DINOv2 generates its embedding, which is compared with the stored embeddings in the vector database. The closest neighbors are identified using the k-nearest neighbors (k-NN) algorithm, and the majority class among them is predicted.\nMultimodal search with NV-CLIP\nNV-CLIP offers a unique advantage: the ability to embed both text and images, enabling\nmultimodal search\n. By converting text and image inputs into embeddings within the same vector space, NV-CLIP facilitates the retrieval of images that match a given text query. This enables highly flexible and accurate search results.\nFigure 6. Multimodal search (image and text) with NV-CLIP\nIn this workflow, users upload a folder of images, which are embedded and stored in a vector database. Using the UI, they can type a query, and NV-CLIP retrieves the most similar images based on the input text.\nMore advanced agents can be built using this approach with VLMs to create multimodal RAG workflows, enabling visual AI agents to build on past experiences and improve responses.\nGet started with visual AI agents today\nReady to dive in and start building your own visual AI agents? Use the code provided in the\n\/NVIDIA\/metropolis-nim-workflows\nGitHub repo as a foundation to develop your own custom workflows and AI solutions powered by NIM microservices. Let the example inspire new applications that solve your specific challenges.\nFor any technical questions or support, join our community and engage with experts in the\nNVIDIA Visual AI Agent forum\n.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/build-multimodal-visual-ai-agents-powered-by-nvidia-nim\/","jp_title":"NVIDIA NIM によるマルチモーダル ビジュアル AI エージェントの構築","jp_content":"Reading Time:\n3\nminutes\n画像から PDF、ストリーミング動画に至るまで、ビジュアル データが指数関数的に急増しているため、手動によるレビューと分析は事実上不可能になっています。企業は、このデータを大規模に実用的な洞察に変えるのに苦労しており、その結果、機会逸失やリスクの増大につながっています。\nこの課題を解決するために、画像や動画の視覚認識とテキストベースの推論を組み合わせた強力なツールとして、ビジョン言語モデル (VLM) が登場しています。テキストのみを処理する従来の\n大規模言語モデル\n(LLM) とは異なり、VLM は複雑なマルチモーダル データを理解し、それに基づいて行動する\nビジュアル AI エージェント\nを構築できるため、リアルタイムの意思決定と自動化が可能になります。\nリモート カメラの映像を解析して山火事の初期兆候を検出したり、ビジネス文書をスキャンして、図表、画像に埋もれている重要な情報を抽出したりするインテリジェントな AI エージェントを想像してみてください。そのすべてを自律的に行うのです。\nNVIDIA NIM マイクロサービス\nを使用すれば、これらの高度なビジュアル AI エージェントの構築がこれまで以上に簡単で効率的になります。柔軟なカスタマイズ、合理的な API 統合、スムーズなデプロイなどを可能にする NIM マイクロサービスにより、独自のビジネス ニーズに合わせた動的なエージェントを作成できます。\nこの記事では、NVIDIA NIM マイクロサービスを使用してインテリジェントなビジュアル AI エージェントを設計および構築するプロセスについて説明します。現在利用可能なさまざまな種類のビジョン AI モデルを紹介し、4 つのサンプル アプリケーション (ストリーミング動画アラート、構造化テキスト抽出、マルチモーダル検索、Few-shot 分類) を共有し、Jupyter ノートブックを提供して利用を開始するお手伝いをします。これらのモデルを実際に使用する方法の詳細については、GitHub リポジトリ\n\/NVIDIA\/metropolis-nim-workflows\nを参照してください。\nビジョン AI モデルの種類\n堅牢なビジュアル AI エージェントを構築するには、以下の中核となるビジョン モデルを利用できます。\nVLM\n埋め込みモデル\nコンピューター ビジョン (CV) モデル\nこれらのモデルは、インテリジェントなビジュアル AI エージェントを開発するための、重要な構成要素となります。VLM は各エージェントのコア エンジンとして機能しますが、CV と埋め込みモデルは、オブジェクト検出などのタスクの精度を向上させたり、複雑な文書を解析したりすることで、その機能を強化できます。\nこの記事では、\nビジョン NIM マイクロサービス\nを使用して、これらのモデルにアクセスします。各ビジョン NIM マイクロサービスは、シンプルな REST API を通じて簡単にワークフローに統合できるため、テキスト、画像、動画における効率的なモデル推論が可能になります。まず、ローカルの GPU を必要としない、\nbuild.nvidia.com\nにホストされているプレビュー API を試してみることができます。\n図 1. build.nvidia.com の llama-3.2-vision-90b モデル\nビジョン言語モデル\nVLM は、ビジョン機能を追加してマルチモーダルにすることで、言語モデルに新たな次元をもたらします。こういったモデルは、画像、動画、テキストを処理できるため、ビジュアル データを解釈し、テキストベースの出力を生成できます。VLM は汎用性が高く、特定のユース ケースに合わせてファインチューニングしたり、ビジュアル入力に基づく Q&A などのタスクを実行するためにプロンプトを設定したりできます。\nNVIDIA とそのパートナーは、サイズ、レイテンシ、機能がそれぞれ異なる複数の VLM を NIM マイクロサービスとして提供しています (表 1)。\n企業名\nモデル\nサイズ\n説明\nNVIDIA\nVILA\n40B\nSigLIP と Yi を基に構築された強力かつ汎用的なモデルで、ほぼあらゆるユース ケースに適しています。\nNVIDIA\nNeva\n22B\nNVGPT と CLIP を組み合わせた中規模モデルで、より大規模なマルチモーダル モデルと同等の機能を提供します。\nMeta\nLlama 3.2\n90B\/11B\n初めてビジョン機能に対応した 2 つのサイズの Llama モデルで、さまざまなビジョン言語タスクに優れ、高解像度の入力に対応しています。\nMicrosoft\nphi-3.5-vision\n4.2B\nOCR に優れ、複数の画像を処理できる小規模で高速なモデル。\nMicrosoft\nFlorence-2\n0.7B\nシンプルなテキスト プロンプトを使用して、キャプション作成、オブジェクト検出、セグメンテーションが可能なマルチタスク モデル。\n表 1. VLM NIM マイクロサービス\n埋め込みモデル\n埋め込みモデルは、入力データ (画像やテキストなど) を埋め込みと呼ばれる高密度の特徴豊富なベクトルに変換します。このような埋め込みは、データの本質的な特徴関係性をまとめ、類似検索や分類などのタスクを可能にします。埋め込みは通常、\nベクトル データベース\nに保存され、GPU アクセラレーションによる検索で関連データを迅速に取得できます。\n埋め込みモデルは、インテリジェント エージェントを作成する際に重要な役割を果たします。たとえば、\n検索拡張生成\n(RAG) ワークフローをサポートし、エージェントがさまざまなデータ ソースから関連情報を引き出し、文脈内学習 (In-Context Learning) を通じて精度を向上させることを可能にします。\n企業名\nモデル\n説明\n事例\nNVIDIA\nNV-CLIP\nテキストおよび画像の埋め込みを生成するマルチモーダルの基盤モデル\nマルチモーダル検索、ゼロショット分類\nNVIDIA\nNV-DINOv2\n高解像度の画像の埋め込みを生成するビジョン基盤モデル\n類似検索、Few-shot 分類\n表 2. 埋め込み NIM マイクロサービス\nコンピューター ビジョン モデル\nCV モデルは、画像分類、オブジェクト検出、光学文字認識 (OCR) などの専門的タスクに重点を置いています。これらのモデルは、詳細なメタデータを追加することで VLM を強化し、AI エージェントの全体的なインテリジェンスを改善することができます。\n企業名\nモデル\n説明\n事例\nNVIDIA\nGrounding Dino\nオープン ボキャブラリ オブジェクト検出\nあらゆるものを検出\nNVIDIA\nOCDRNet\n光学文字検出と認識\n文書解析\nNVIDIA\nChangeNet\n2 つの画像間のピクセル レベルの変化を検出\n欠陥検出、衛星画像分析\nNVIDIA\nRetail Object Detection\n一般的な小売商品を検出するために事前学習済み\n損失防止\n表 3. コンピューター ビジョン NIM マイクロサービス\nビジョン NIM マイクロサービスでビジュアル AI エージェントを構築\nビジョン NIM マイクロサービスを適用して強力なビジュアル AI エージェントを作成する方法の実例を示します。\nNVIDIA NIM マイクロサービスを活用したアプリケーション開発をより身近なものにするために、NVIDIA は GitHub に一連の例を公開しています。これらの例では、NIM API を使用してアプリケーションを構築または統合する方法を紹介しています。個々の例には、GPU がなくても簡単に起動できる Jupyter ノートブックのチュートリアルとデモが含まれています。\nNVIDIA API カタログ\nで、\nLlama3.1 405B\nなどのモデル ページを選択します。[\nGet API Key\n] (API キーを入手) を選択して 90 日間の\nNVIDIA AI Enterprise\nライセンス用の\nビジネス用メールを入力\nするか、\nNVIDIA 開発者プログラム\nを通じて\nNIM にアクセス\nする個人用メール アドレスを使用します。\nGitHub リポジトリ\n\/NVIDIA\/metropolis-nim-workflows\nで、Jupyter ノートブックのチュートリアルとデモを参照します。これらのワークフローでは、ビジョン NIM マイクロサービスをベクトル データベースや LLM などの他のコンポーネントと組み合わせ、現実の問題を解決する強力な AI エージェントを構築する方法を紹介しています。API キーがあれば、この記事で紹介されているワークフローを簡単に再現でき、ビジョン NIM マイクロサービスを実際に体験できます。\n以下にワークフローの例を示します。\nVLM ストリーミング動画アラート エージェント\n構造化テキスト抽出エージェント\nNV-DINOv2 エージェントによる Few-shot 分類\nNV-CLIP エージェントによるマルチモーダル検索\nVLM ストリーミング動画アラート エージェント\n毎秒膨大な量の動画データが生成される状況で、パッケージの配送、森林火災、不正アクセスなどの重要なイベントの映像を手動で確認することは不可能です。\nこのワ��クフローでは、VLM、Python、OpenCV を使用して、\nユーザー定義イベントのライブ ストリームを自律的に監視する\nAI エージェントを構築する方法を示しています。イベントが検出されると、アラートが生成され、膨大な時間を要する手動での動画レビューにかかる時間を短縮できます。VLM の柔軟性のおかげで、プロンプトを変更することで新しいイベントを検出できます。そのため、新しいシナリオごとにカスタム CV モデルを構築およびトレーニングする必要がありません。\n動画 1. NVIDIA NIM を活用したビジュアル AI エージェント\n図 2 では、VLM はクラウドで実行され、動画ストリーミング パイプラインはローカルで動作します。このセットアップでは重い計算が NIM マイクロサービスを通じてクラウドにオフロードされ、ほぼすべてのハードウェア上でデモを実行できるようになります。\n図 2. ストリーミング動画アラート エージェントのアーキテクチャ\nこのエージェントを構築する手順は以下のとおりです。\n動画ストリームの読み込みと処理\n: OpenCV を使用して、動画ストリームまたはファイルの読み込み、デコード、フレームのサブサンプルを実行します。\nREST API エンドポイントの作成:\nFastAPI を使用して、ユーザーがカスタム プロンプトを入力できる制御用の REST API エンドポイントを作成します。\nVLM API との統合:\nラッパー クラスでは、動画フレームとユーザー プロンプトを送信することで、VLM API とのやりとりを処理します。NIM API リクエストを形成し、応答を解析します。\n応答を動画上にオーバーレイ:\nVLM 応答は入力動画にオーバーレイされ、OpenCV を使用してストリーミング配信され、リアルタイム表示されます。\nアラートをトリガー:\n解析された応答を WebSocket サーバーに送信して他のサービスと統合し、検出されたイベントに基づいて通知をトリガーします。\nVLM を活用したストリーミング動画アラート エージェントの構築に関する詳細については、GitHub の\n\/NVIDIA\/metropolis-nim-workflows\nのノートブック チュートリアルとデモをご覧ください。さまざまな VLM NIM マイクロサービスを試し、ユース ケースに最適なモデルを見つけることができます。\nNVIDIA Jetson\nと\nJetson プラットフォーム サービス\nを駆使して VLM がエッジ アプリケーションをどのように変革するかについては、「\nEdge 向けの生成 AI を活用したビジュアル AI エージェントを開発する\n」を参照してください。また、\nJetson プラットフォーム サービス\nページでは追加の関連情報もご覧いただけます。\n構造化テキスト抽出エージェント\n多くのビジネス文書は、PDF などの検索可能なフォーマットではなく、画像として保存されています。そのため、これらの文書の検索と処理を行う際には、手動によるレビュー、タグ付け、整理が必要になることが多くあり、これらが大きな課題となります。\n光学文字検出と認識 (OCDR) モデルは、しばらく前から存在していましたが、元のフォーマットを保持できなかったり、ビジュアル データを解釈できなかったりして、雑然とした結果を返すことがよくありました。これは、さまざまな形やサイズがある写真付き ID などの不規則な形式の文書を扱う場合に特に困難になります。\n従来の CV モデルは、そのような文書の処理に時間とコストがかかります。しかし、VLM と LLM の柔軟性と、OCDR モデルの精度を組み合わせることで、\n強力なテキスト抽出パイプラインを構築して文書を自律的に解析し\n、データベースにユーザー定義のフィールドを保存することができます。\n図 3. 構造化テキスト抽出エージェントのアーキテクチャ\n構造化テキスト抽出パイプラインの構築手順は次のとおりです。\n文書入力:\nOCDRNet や Florence などの OCDR モデルに文書の画像を提供すると、文書内の検出されたすべての文字のメタデータが返されます。\nVLM の統合:\nVLM は、希望するフィールドを指定するユーザーのプロンプトを処理し、文書を分析します。OCDR モデルで検出された文字を使用して、より正確な応答を生成します。\nLLM のフォーマット:\nVLM の応答は LLM に渡され、LLM はデータを JSON 形式に整形し、表として表示します。\n出力と保存:\n抽出されたフィールドは構造化されたフォーマットにまとめられ、データベースに挿入したり、将来の使用に備えて保存したりできます。\n図 4. ビジョン NIM マイクロサービスによる構造化テキスト抽出の例\nプレビュー API を使用すると、複数のモデルを組み合わせて複雑なパイプラインを構築し、簡単に実験をすることができます。デモ UI から、\nbuild.nvidia.com\nで利用可能な各種の VLM、OCDR、LLM モデルを切り替えることができ、素早く実験できます。\nNV-DINOv2 による Few-shot 分類\nNV-DINOv2 は、高解像度の画像から埋め込みを生成するため、少数のサンプル画像での欠陥検出など、詳細な分析を必要とする作業に理想的です。このワークフローは、NV-DINOv2 と Milvus ベクトル データベースを使用して、\nスケーラブルな Few-shot 分類パイプライン\nを構築する方法を示しています。\n図 5. NV-DINOv2による Few-shot 分類\nFew-shot 分類パイプラインの仕組みは次のとおりです。\nクラスの定義と、サンプルのアップロード:\nユーザーはクラスを定義し、それぞれに少数のサンプル画像をアップロードします。NV-DINOv2 は、これらの画像から埋め込みを生成し、クラス ラベルとともに Milvus ベクトル データベースに保存します。\n新しいクラスを予測:\n新しい画像がアップロードされると、NV-DINOv2 はその埋め込みを生成し、ベクトル データベースに保存されている埋め込みと比較します。k近傍法 (k-NN) アルゴリズムを使用して最も近い隣接データを特定し、その中から多数派クラスのクラスが予測されます。\nNV-CLIP によるマルチモーダル検索\nNV-CLIP は、テキストと画像の両方を埋め込むことができ、\nマルチモーダル検索\nを可能にするという独自の利点があります。 テキストと画像の入力を同じベクトル空間内の埋め込みに変換することで、NV-CLIP は、指定されたテキスト クエリに一致する画像の検索を容易にします。これにより、柔軟性が高く正確な検索結果が得られます。\n図 6. NV-CLIP によるマルチモーダル検索 (画像とテキスト)\nこのワークフローでは、ユーザーは画像フォルダをアップロードし、画像は埋め込みに変換され、ベクトル データベースに保存されます。UI を使用してクエリを入力すると、NV-CLIP は、入力テキストに基づいて最も類似した画像を検索します。\nこのアプローチを VLM と使用して、より高度なエージェントを構築し、マルチモーダル RAG ワークフローを作成することができます。これにより、ビジュアル AI エージェントが過去の経験を基に構築され、応答を改善できるようになります。\n今すぐビジュアル AI エージェントを始めましょう\n独自のビジュアル AI エージェントを構築する準備はできましたか? GitHub リポジトリ\n\/NVIDIA\/metropolis-nim-workflows\nで提供されているコードをベースとして、NIM マイクロサービスを利用した独自のカスタム ワークフローと AI ソリューションを開発してみてください。この例を参考に、あなたの組織固有の課題を解決する新しいアプリケーションを開発しましょう。\n技術的な質問やサポートが必要な場合は、NVIDIA のコミュニティに参加し、\nNVIDIA ビジュアル AI エージェント フォーラム\nのエキスパートと交流してください。\n関連情報\nGTC セッション:\nCreate purpose-built AI using vision and language With multi-modal Foundation Models (マルチモーダルの基盤モデルを活用したビジョンと言語による目的別 AI の作成)\nNGC コンテナー:\nLlama-3.2-90B-Vision-Instruct\nNGC コンテナー:\nLlama-3.2-11B-Vision-Instruct\nNGC コンテナー:\nrag-application-multimodal-chatbot\nSDK:\nLlama3 70B Instruct NIM\nSDK:\nBioNeMo Service"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/an-introduction-to-model-merging-for-llms\/","en_title":"An Introduction to Model Merging for LLMs","en_content":"One challenge organizations face when customizing\nlarge language models (LLMs)\nis the need to run multiple experiments, which produces only one useful model. While the cost of experimentation is typically low, and the results well worth the effort, this experimentation process does involve “wasted” resources, such as compute assets spent without their product being utilized, dedicated developer time, and more.\nModel merging combines the weights of multiple customized LLMs, increasing resource utilization and adding value to successful models. This approach provides two key solutions:\nReduces experimentation waste by repurposing “failed experiments”\nOffers a cost-effective alternative to join training\nThis post explores how models are customized, how model merging works, different types of model merging, and how model merging is iterating and evolving.\nRevisiting model customization\nThis section provides a brief overview of how models are customized and how this process can be leveraged to help build an intuitive understanding of model merging.\nNote that some of the concepts discussed are oversimplified for the purpose of building this intuitive understanding of model merging. It is suggested that you familiarize yourself with customization techniques, transformer architecture, and training separately before diving into model merging. See, for example,\nMastering LLM Techniques: Customization\n.\nThe role of weight matrices in models\nWeight matrices are essential components in many popular model architectures, serving as large grids of numbers (weights, or parameters) that store the information necessary for the model to make predictions.\nAs data flows through a model, it passes through multiple layers, each containing its own weight matrix. These matrices transform the input data through mathematical operations, enabling the model to learn from and adapt to the data.\nTo modify a model’s behavior, the weights within these matrices must be updated. Although the specifics of weight modification are not essential, it’s crucial to understand that each customization of a base model results in a unique set of updated weights.\nTask customization\nWhen fine-tuning an LLM for a specific task, such as summarization or math, the updates made to the weight matrices are targeted towards improving performance on that particular task. This implies that the modifications to the weight matrices are localized to specific regions, rather than being uniformly distributed.\nTo illustrate this concept, consider a simple analogy where the weight matrices are represented as a sports field that is 100 yards in length. When customizing the model for summarization, the updates to the weight matrices might concentrate on specific areas, such as the 10-to-30 yard lines. In contrast, customizing the model for math might focus updates on a different region, like the 70-to-80 yard lines.\nInterestingly, when customizing the model for a related task, such as summarization in the French language, the updates might overlap with the original summarization task, affecting the same regions of the weight matrices (the 25-to-35 yard lines, for example). This overlap suggests an important insight: different task customizations can significantly impact the same areas of the weight matrices.\nWhile the previous example is purposefully oversimplified, the intuition is accurate. Different task customizations will lead to different parts of the weight matrices being updated, and customization for similar tasks might lead to changing the same parts of their respective weight matrices.\nThis understanding can inform strategies for customizing LLMs and leveraging knowledge across tasks.\nModel merging\nModel merging is a loose grouping of strategies that relates to combining two or more models, or model updates, into a single model for the purpose of saving resources or improving task-specific performance.\nThis discussion focuses primarily on the implementation of these techniques through an open-source library developed by\nArcee AI\ncalled\nmergekit\n. This library simplifies the implementation of various merging strategies.\nMany methods are used to merge models, in various levels of complexity. Here, we’ll focus on four main merging methods:\nModel Soup\nSpherical Linear Interpolation (SLERP)\nTask Arithmetic (using Task Vectors)\nTIES leveraging DARE\nModel Soup\nThe Model Soup method involves averaging the resultant model weights created by hyperparameter optimization experiments, as explained in\nModel Soups: Averaging Weights of Multiple Fine-Tuned Models Improves Accuracy Without Increasing Inference Time\n.\nOriginally tested and verified through computer vision models, this method has shown promising results for LLMs as well. In addition to generating some additional value out of the experiments, this process is simple and not compute intensive.\nThere are two ways to create Model Soup: naive and greedy. The naive approach involves merging all models sequentially, regardless of their individual performance. In contrast, the greedy implementation follows a simple algorithm:\nRank models by performance on the desired task\nMerge the best performing model with the second best performing model\nEvaluate the merged model’s performance on the desired task\nIf the merged model performs better, continue with the next model; otherwise, skip the current model and try again with the next best model\nThis greedy approach ensures that the resulting Model Soup is at least as good as the best individual model.\nFigure 1. The Model Soup method outperforms the constituent models using the greedy model Soup Model merging technique\nEach step of creating a Model Soup is implemented by simple weighted and normalized linear averaging of two or more model weights. Both the weighting and normalization are optional, though recommended. The implementation of this from the\nmergekit\nlibrary is as follows:\nres = (weights * tensors).sum(dim=0)\nif self.normalize:\n\tres = res \/ weights.sum(dim=0)\nWhile this method has shown promising results in the computer vision and language domains, it faces some serious limitations. Specifically, there is no guarantee that the model will be more performant. The linear averaging can lead to degraded performance or loss of generalizability.\nThe next method, SLERP, addresses some of those specific concerns.\nSLERP\nSpherical Linear Interpolation, or SLERP, is a method introduced in a 1985 paper titled\nAnimating Rotation with Quaternion Curves\n. It’s a “smarter” way of computing the average between two vectors. In a technical sense, it helps compute the shortest path between two points on a curved surface.\nThis method excels at combining two models. The classic example is imagining the shortest path between two points on the Earth. Technically, the shortest path would be a straight line that goes through the Earth, but in reality it’s a curved path on the surface of the Earth. SLERP computes this smooth path to use for averaging two models together while maintaining their unique model weight “surfaces.”\nThe following code snippet is the core of the SLERP algorithm, and is what provides such a good interpolation between the two models:\n# Calculate initial angle between v0 and v1\ntheta_0 = np.arccos(dot)\nsin_theta_0 = np.sin(theta_0)\n\n# Angle at timestep t\ntheta_t = theta_0 * t\nsin_theta_t = np.sin(theta_t)\n\n# Finish the slerp algorithm\ns0 = np.sin(theta_0 - theta_t) \/ sin_theta_0\ns1 = sin_theta_t \/ sin_theta_0\nres = s0 * v0_copy + s1 * v1_copy\n\nreturn maybe_torch(res, is_torch)\nTask Arithmetic (using Task Vectors)\nThis group of model merging methods utilizes Task Vectors to combine models in various ways, increasing in complexity.\nTask Vectors: Capturing customization updates\nRecalling how models are customized, updates are made to the model’s weights, and those updates are captured in the base model matrices. Instead of considering the final matrices as a brand new model, they can be viewed as the difference (or delta) between the base weights and the customized weights. This introduces the concept of a task vector,a structure containing the delta between the base and customized weights.\nThis is the same intuition behind Low Rank Adaptation (LoRA), but without the further step of factoring the matrices representing the weight updates.\nTask Vectors can be simply obtained from customization weights by subtracting out the base model weights.\nTask Interference: Conflicting updates\nRecalling the sports field example, there is a potential for overlap in the updated weights between different customizations. There is some intuitive understanding that customization done for the same task would lead to a higher rate of conflicting updates than customization done for two, or more, separate tasks.\nThis “conflicting update” idea is more formally defined as Task Interference and it relates to the potential collision of important updates between two, or more, Task Vectors.\nTask Arithmetic\nAs introduced in the paper\nEditing Models with Task Arithmetic\n, Task Arithmetic represents the simplest implementation of a task vector approach. The process is as follows:\nObtain two or more task vectors and merge them linearly as seen in Model Soup.\nAfter the resultant merged task vector is obtained, it is added into the base model.\nThis process is simple and effective, but has a key weakness: no attention is paid to the potential interference between the task vectors intended to be merged.\nTIES-Merging\nAs introduced in the paper\nTIES-Merging: Resolving Interference When Merging Models\n, TIES (TrIm Elect Sign and Merge) is a method that takes the core ideas of Task Arithmetic and combines it with heuristics for resolving potential interference between the Task Vectors.\nThe general procedure is to consider, for each weight in the Task Vectors being merged, the magnitude of each incoming weight, then the sign of each incoming weight, and then averaging the remaining weights.\nFigure 2. A visual representation of the TIES process\nThis method seeks to resolve interference by enabling the models that had the most significant weight updates for any given weight update take precedence during the merging process. In essence, the models that “cared” more about that weight would be prioritized over the models that did not.\nDARE\nIntroduced in the paper\nLanguage Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch\n, DARE isn’t directly a model merging technique. Rather, it’s an augment that can be considered alongside other approaches. DARE derives from the following:\nD\nrops delta parameters with a ratio p\nA\nnd\nRE\nscales the remaining ones by 1\/(1 – p) to approximate the original embeddings.\nInstead of trying to address the problem of interference through heuristics, DARE approaches it from a different perspective. In essence, it randomly drops a large number of the updates found in a specific task vector by setting them to 0, and then rescales the remaining weight proportional to the ratio of the dropped weights.\nDARE has been shown to be effective even when dropping upwards of 90%, or even 99% of the task vector weights.\nIncrease model utility with model merging\nThe concept of model merging offers a practical way to maximize the utility of multiple LLMs, including task-specific fine-tuning done by a larger community. Through techniques like Model Soup, SLERP, Task Arithmetic, TIES-Merging, and DARE, organizations can effectively merge multiple models in the same family in order to reuse experimentation and cross-organizational efforts.\nAs the techniques behind model merging are better understood and further developed, they are poised to become a cornerstone of the development of performant LLMs. While this post has only scratched the surface, more techniques are constantly under development, including some\nevolution-based methods\n. Model merging is a budding field in the generative AI landscape, as more applications are being tested and proven.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/an-introduction-to-model-merging-for-llms\/","jp_title":"LLM のモデル マージのご紹介","jp_content":"Reading Time:\n2\nminutes\n大規模言語モデル (LLM)\nをカスタマイズする際に、組織が直面する課題の 1 つは、複数の実験を実行する必要があるのに、その結果得られるのは 1 つの有用なモデルのみということです。 実験にかかるコストは通常低く、労力に見合う成果が得られるものの、この実験プロセスには、実験に割り当てされてるけど使用率の低いまたは、全く稼働していない計算機や専任の開発者が費やす時間など、「無駄な」リソースが含まれます。\nモデル マージは、複数のカスタマイズされた LLM の重みを組み合わせることで、リソースの利用率を高め、成功したモデルに付加価値を加えます。 このアプローチは、2 つの重要なソリューションを提供します。\n「失敗した実験」を別の目的に使用することで、実験の無駄を削減する\nトレーニングに参加するためのコスト効率の高い代替手段を提供する\n本投稿では、モデルがどのようにカスタマイズされるのか、モデル マージがどのように機能するのか、さまざまな種類のモデル マージ、およびモデル マージがどのように繰り返され、進化しているのかについて探ります。\nモデル カスタマイズ再訪\nこのセクションでは、モデルがどのようにカスタマイズされるか、またこのプロセスをどのように活用することで、モデル マージを直感的に理解できるのかについて簡単に説明します。\nここで説明されている概念の一部は、モデル マージに対する直感的な理解をを深めるために、過度に単純化されていることがあります。 モデル マージを始める前に、カスタマイズ技術、Transformer アーキテクチャおよびトレーニングについては、個別に理解しておくことをお勧めします。 たとえば、\n大規模言語モデルのカスタマイズ手法を選択する\nなどを参考にしてください。\nモデルにおける重み行列の役割\n重み行列は、多くの一般的なモデル アーキテクチャにおいて必須のコンポーネントであり、モデルが予測を行うのに必要な情報を格納する大きなグリッド (重み、またはパラメーター) として機能します。\nデータはモデルを流れる際には複数のレイヤーを通過しますが、その各レイヤーには独自の重み行列が含まれています。 これらの行列は、数学演算を通じて入力データを変換し、モデルがデータから学び、それらに適応できるようにします。\nモデルの動作を変更するには、これらの行列内の重みを更新する必要があります。 重みを変更する際の詳細は重要ではありませんが、ベースのモデルをカスタマイズする度に、更新された重みの一意なセットが生成されることを理解することが重要です。\nタスクのカスタマイズ\n要約や数学などの特定のタスクのために LLM をファインチューニングする場合、重み行列に行われた更新は、その特定のタスクのパフォーマンスを向上させるために行われます。 これは、重み行列への変更は均等に分布されるのではなく、特定の領域に限定されることを意味します。\nこの概念を説明するために、重み行列を 100 ヤードのスポーツフィールドに見立てた単純な例について考えてみましょう。要約するためにモデルをカスタマイズする場合、重み行列への更新は、10~30 ヤードのラインなどの特定の領域に集中する可能性があります。 対照的に、モデルを数学向けにカスタマイズする場合、70~80 ヤードのラインなど、別の領域に更新が集中する可能性があります。\n興味深いことに、フランス語の要約など、関連するタスクのモデルをカスタマイズする場合、更新が元々の要約タスクと重複し、重み行列 (例えば、25~35 ヤード)の同じ領域に影響を及ぼす可能性があります。 この重複部分は、重要な洞察を示しています。異なるタスクのカスタマイズが、重み行列内の同じ領域に大きな影響を与える可能性があるのです。\n前述の例は意図的に単純化されたものですが、直感は正確です。 異なるタスクのカスタマイズにより、重み行列の異なる部分が更新されることにつながります。また、類似したタスクをカスタマイズすると、それぞれの重み行列の同じ部分が変更される可能性があります。\nこのことを理解することは、LLM をカスタマイズしたり、タスク全体で知識を活用する際の戦略に役立ちます。\nモデル マージ\nモデル マージとは、リソースの節約やタスク固有のパフォーマンス向上を目的として、2 つ以上のモデルまたはモデルの更新を 1 つのモデルにまとめることに関連した戦略を大まかにグループ化することです。\nここでは、\nArcee AI\nが開発した\nmergekit\nと呼ばれるオープンソース ライブラリを通じて、これらの技術を実装することに主に焦点を当てます。 このライブラリは、さまざまなマージ戦略の実装を簡素化します。\nモデルのマージに使用される方法は数多くあり、その複雑さも様々です。 ここでは、主な 4 つのマージ方法を取り上げます。\nModel Soup\n球面線型補間 (SLERP: Spherical Linear Interpolation)\nTask Arithmetic (Task Vector を使用)\nDARE を活用した TIES\nModel Soup\nModel Soup メソッドでは、ハイパー パラメーター最適化実験によって得られたモデルの重みを平均化します。これについては、\nModel Soups: Averaging Weights of Multiple Fine-Tuned Models Improves Accuracy Without Increasing Inference Time\nに説明されています。\n当初、コンピューター ビジョン モデルを通じてテストと検証が行われたこの方法は、LLM でも有望な結果を示しています。 実験から何らかの付加価値を生み出すだけでなく、このプロセスは単純で、計算量も多くありません。\nModel Soup を作成する方法には、Naive と Greedy の 2 つの方法があります。 Naive アプローチでは、個々のパフォーマンスに関係なく、すべてのモデルを順次マージします。 これとは対照的に、Greedy 実装は以下の単純なアルゴリズムに従ったものになります。\n目的のタスクのパフォーマンスに基づいてモデルをランク付けする\n最も良いパフォーマンス モデルと、2 番目に良いパフォーマンス モデルをマージする\nマージされたモデルのパフォーマンスを、目的のタスクで評価する\nマージされたモデルがより良いパフォーマンスを発揮する場合は、次のモデルで続行する。そうでない場合は、現在のモデルをスキップし、次の最も良いモデルで再試行する\nこの Greedy アプローチでは、結果として得られる Model Soup が、少なくとも最良の個々のモデルと同等の品質になることを保証します。\n図 1. Model Soup メソッドは、Greedy モデル マージ技術を使用することで、個々のモデルよりも優れた性能を発揮します\nModel Soup を作成する各手順は、2 つ以上のモデルの重みを単純に重み付けし、正規化した線形平均を取ることで実装されます。重み付けと正規化はどちらもオプションですが、推奨されます。\nmergekit\nライブラリから実装する場合は、以下のようになります。\nres = (weights * tensors).sum(dim=0)\nif self.normalize:\n res = res \/ weights.sum(dim=0)\nこの方法は、コンピューター ビジョンや言語の領域で有望な結果を示していますが、いくつかの深刻な限界に直面しています。 具体的には、モデルがより優れた性能を発揮できるという保証はありません。 線形平均化は、性能の低下や、汎化性能の喪失につながることがあります。\n次のメソッドとなる SLERP は、これらの特定の懸念の一部に対処します。\nSLERP\n球面線型補間 (SLERP: Spherical Linear Interpolation) は、1985 年に\nAnimating Rotation with Quaternion Curves\nと題された論文で紹介された方法です。 これは、2 つのベクトル間の平均を計算する「よりスマート」な方法です。 技術的な意味では、曲面上の 2 つの点間の最短経路を計算するのに役立ちます。\nこの方法では、2 つのモデルを組み合わせることに優れています。 典型的な例としては、地球上の 2 つの地点間の最短経路を想像してみてください。技術的には、最短経路は地球を貫く直線になりますが、実際には地球表面に沿った曲線になります。 SLERP は、2 つのモデルの独自の重み「表面」を維持しながら平均化し、この滑らかな経路を計算します。\n以下のコードの抜粋は、SLERP アルゴリズムの中核部分であり、2 つのモデル間の補間をうまく行います。\n# Calculate initial angle between v0 and v1\ntheta_0 = np.arccos(dot)\nsin_theta_0 = np.sin(theta_0)\n \n# Angle at timestep t\ntheta_t = theta_0 * t\nsin_theta_t = np.sin(theta_t)\n \n# Finish the slerp algorithm\ns0 = np.sin(theta_0 - theta_t) \/ sin_theta_0\ns1 = sin_theta_t \/ sin_theta_0\nres = s0 * v0_copy + s1 * v1_copy\n \nreturn maybe_torch(res, is_torch)\nTask Arithmetic (Task Vector を使用)\nこのモデル マージ法では、Task Vector を使用してさまざまな方法でモデルを組み合わせることで、複雑さを高めていきます。\nTask Vector: カスタマイズの更新をキャプチャ\nモデルがどのようにカスタマイズされるのかを思い出してください。モデルの重みが更新され、それらの更新がベース モデルの行列にキャプチャされます。 最終的な行列を真新しいモデルとみなす代わりに、ベースの重みとカスタマイズした重みの差 (またはデルタ) として見ることができます。 これにより、ベースの重みとカスタマイズした重みとの間のデルタが含まれる構造である Task Vector の概念が導入されます。\nこれは、LoRA (Low Rank Adaptation) と同じ考え方ですが、重みの更新を表す行列を因数分解する追加のステップはありません。\nTask Vector は、ベース モデルの重みを減算することで、カスタマイズの重みから簡単に取得できます。\nTask Interference: 更新の競合\nスポーツ フィールドの例を思い出してください。異なるカスタマイズ間で更新された重みが重なり合う可能性がありました。 同じタスクに対してカスタマイズすると、2 つ以上の別々のタスクに対してカスタマイズを行う場合よりも、高い割合で更新の競合を引き起こすことは直感的に理解できます。\nこの「更新の競合」という考え方は、より正式には Task Interference (タスクの干渉) として定義されており、2 つ以上の タスク ベクトル間の重要なアップデートが衝突する可能性に関連しています。\nTask Arithmetic\nEditing Models with Task Arithmetic\nの論文で紹介されたように、Task Arithmetic は Task Vector アプローチの最も単純な実装です。 プロセスは以下のとおりです。\n2 つ以上のタスク ベクトルを取得し、Model Soup で見られるように線形なマージをする。\n結果としてマージされた Task Vector が得られたら、ベース モデルに追加する。\nこのプロセスは単純で効果的ですが、マージされる予定の Task Vector 間の潜在的な干渉には注意が払われないという、重大な弱点があります。\nTIES-Merging\nTIES-Merging: Resolving Interference When Merging Models\nの論文に紹介されているように、TIES (TrIm Elect Sign and Merge) は、Task Arithmetic の中核となるアイデアを取り入れ、それを Task Vector 間の潜在的な干渉を解決するためのヒューリスティックと組み合わせる方法です。\n一般的な手順では、マージされる Task Vector 内の重みごとに、各入力される重みの大きさ、次に各入力される重みの符号を考慮し、その後残りの重みを平均化します。\n図 2. TIES プロセスの図による解説\nこの方法は、任意の重み更新において最も大きな重みに対する更新を行ったモデルを、マージ プロセスにおいて優先されるようにすることで、干渉を解決しようとするものです。要するに、その重みをより「考慮する」モデルが、そうでないモデルよりも優先されます。\nDARE\nLanguage Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch\nの論文に紹介されている通り、DARE は直接的なモデル マージの技術ではありません。 むしろ、他のアプローチと並行して検��することができる補強です。 DARE は、以下から由来しています。\nD\nrops delta parameters with a ratio p\nA\nnd\nRE\nscales the remaining ones by 1\/(1 – p) to approximate the original embeddings (デルタ パラメーターを p の比率でドロップし、残りのパラメーターを 1\/ (1 – p) で再スケールして元の埋め込みに近似する)。\nヒューリスティックによって干渉の問題に対処しようとするのではなく、DARE は別の観点からアプローチします。 具体的には、特定の Task Vector で見つかった多数の更新を、0 に設定することでランダムにドロップし、ドロップされた重みの比率に比例して残りの重みを再スケールします。\nDARE は、Task Vector の重みが 90% 以上、あるいは 99% 以上ドロップされた場合でも、有効であることが示されています。\nモデル マージでモデルの有用性を向上させる\nモデル マージの概念は、より大規模なコミュニティによって行われるタスク固有のファインチューニングをはじめとする、複数の LLM の有用性を最大限に高める実用的な方法を提供します。Model Soup、SLERP、Task Arithmetic、TIES-Merging、DARE などの技術を通じて、実験と組織をまたがる取り組みを再利用するために、同系統の複数のモデルを効果的にマージすることができます。\nモデル マージの背景にある技術がより深く理解され、さらに発展するにつれて、高性能な LLM 開発の礎石となるでしょう。この投稿は、ほんの表面をなぞったに過ぎませんが、\n進化に基づく手法\nなども含め、さらに多くの技術が絶え間なく開発されています。モデル マージは、より多くの応用がテストされ、実証されており、生成 AI の新たな分野となっているのです。\n関連情報\nGTC セッション:\nLLM インフラの構築、学習速度の高速化、生成 AI イノベーションの促進のためのエンドツーエンドのソリューションの設計 (Aivres 提供)\nNGC コンテナー:\ngenai-llm-playground\nNGC コンテナー:\nrag-application-query-decomposition-agent\nウェビナー:\nAI で医療ワークフローを変革: CLLM について深く理解する"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/bringing-ai-ran-to-a-telco-near-you\/","en_title":"Bringing AI-RAN to a Telco Near You","en_content":"Inferencing for generative AI and AI agents will drive the need for AI compute infrastructure to be distributed from edge to central clouds.\nIDC predicts\nthat “Business AI (consumer excluded) will contribute $19.9 trillion to the global economy and account for 3.5% of GDP by 2030.”\n5G networks must also evolve to serve this new incoming AI traffic. At the same time, there is an opportunity for telcos to become the local AI compute infrastructure for hosting enterprise AI workloads, independent of network connectivity while meeting their data privacy and sovereignty requirements. This is where an accelerated computing infrastructure shines – with the ability to accelerate both Radio signal processing and AI workloads. And most importantly, the same compute infrastructure can be used to process AI and radio access network (RAN) services. This combination has been called\nAI-RAN by the telecoms industry\n.\nNVIDIA is introducing Aerial RAN Computer-1, the world’s first AI-RAN deployment platform, that can serve AI and RAN workloads concurrently, on a common accelerated infrastructure.\nFollowing the launch of the\nAI-RAN Innovation Center by T-Mobile\n, the Aerial RAN Computer-1 turns AI-RAN into reality with a deployable platform that telcos can adopt globally. It can be used in small, medium, or large configurations for deployment at cell sites, distributed or centralized sites, effectively turning the network into a multi-purpose infrastructure that serves voice, video, data, and AI traffic.\nThis is a transformative solution that reimagines wireless networks for AI, with AI. It is also a huge opportunity for telcos to fuel the AI flywheel, leveraging their distributed network infrastructure, low latency, guaranteed quality of service, massive scale, and ability to preserve data privacy, security, and localization – all key requirements for AI inferencing and agentic AI applications.\nAI-RAN, AI Aerial, and Aerial RAN Computer-1\nAI-RAN is the technology framework to build multipurpose networks that are also AI-native. As telcos embrace AI-RAN, and move from the traditional single-purpose ASIC-based computing networks for RAN to new multi-purpose accelerated computing-based networks serving RAN and AI together, telcos can now participate in the new AI economy and can leverage AI to improve the efficiency of their networks.\nNVIDIA AI Aerial\nincludes three computer systems to design, simulate, train, and deploy AI-RAN-based 5G and 6G wireless networks. Aerial RAN Computer-1 is the base foundation of NVIDIA AI Aerial and provides a commercial-grade deployment platform for AI-RAN.\nAerial RAN Computer-1 (Figure 1) offers a common scalable hardware foundation to run RAN and AI workloads including – software-defined 5G, Private 5G RAN from NVIDIA or other RAN software providers, containerized network functions, AI microservices from NVIDIA or partners or host internal and third-party generative AI applications. Aerial RAN Computer-1 is modular by design, enabling it to scale from D-RAN to C-RAN architectures covering rural to dense urban use cases.\nNVIDIA CUDA-X Libraries are central to accelerated computing, providing speed, accuracy, and reliability in addition to improved efficiency. That means more work is done in the same power envelope. Most importantly, domain-specific libraries, including telecom-specific adaptations, are key to making Aerial RAN Computer-1 suited for telecom deployments.\nNVIDIA DOCA\noffers a suite of tools and libraries that can significantly boost the performance enhancements for telco workloads, including RDMA, PTP\/timing synchronization, and Ethernet-based fronthaul (eCPRI), as well as AI workloads that are crucial for modern network infrastructure.\nCollectively, the full stack enables scalable hardware, common software, and an open architecture to deliver a high-performance AI-RAN together with ecosystem partners.\nFigure 1. NVIDIA Aerial RAN Computer-1, as a part of the NVIDIA AI Aerial platform\nBenefits of Aerial RAN Computer-1\nWith Aerial RAN Computer-1, wireless networks can turn into a massively distributed grid of AI and RAN data centers, unleashing new monetization avenues for telcos while paving the way for 6G with a software upgrade.\nBenefits of Aerial RAN Computer-1 for telecom service providers include the following:\nMonetize with AI and generative AI applications, AI inferencing at the edge, or with GPU-as-a-Service.\nIncrease utilization of infrastructure by 2-3x compared to single-purpose base stations that are typically only 30% utilized today. Use the same infrastructure to host internal generative AI workloads and other containerized network functions such as UPF and RIC.\nImprove radio network performance through site-specific AI learning, with up to 2x gains possible in spectral efficiency. This means direct cost savings per Mhz of the acquired spectrum.\nDeliver high-performance RAN and AI experiences for next-gen applications that intertwine AI into every interaction. Aerial RAN Computer-1 can service up to 170 Gb\/s throughput in RAN-only mode and 25K tokens\/sec in AI-only mode, or a combination of both with superior performance compared to traditional networks.\nBuilding blocks of Aerial RAN Computer-1\nThe key hardware components of Aerial RAN Computer-1 include the following:\nNVIDIA GB200 NVL2\nNVIDIA Blackwell GPU\nNVIDIA Grace CPU\nNVLink2 C2C\nFifth-generation NVIDIA NVLink\nKey-value caching\nMGX reference architecture\nReal-time mainstream LLM inference\nNVIDIA GB200 NVL2\nThe NVIDIA GB200 NVL2 platform (Figure 2) used in Aerial RAN Computer-1 revolutionizes data center and edge computing, offering unmatched performance for mainstream large language models (LLMs), vRAN, vector database searches, and data processing.\nPowered by two NVIDIA Blackwell GPUs and two NVIDIA Grace CPUs, the scale-out single-node architecture seamlessly integrates accelerated computing into existing infrastructure.\nThis versatility enables a wide range of system designs and networking options, making the GB200 NVL2 platform an ideal choice for data centers, edge, and cell site locations seeking to harness the power of AI as well as wireless 5G connectivity.\nFor instance, half of a GB200 server could be allocated to RAN tasks and the other half to AI processing through\nMulti-instance GPU (MIG)\ntechnology at a single cell site. For aggregated sites, a full GB200 server could be dedicated to RAN, with another used exclusively for AI. In a centralized deployment, a cluster of GB200 servers could be shared between RAN and AI workloads\nNVIDIA Blackwell GPU\nNVIDIA Blackwell is a revolutionary architecture that delivers improved performance, efficiency, and scale. NVIDIA Blackwell GPUs pack 208B transistors and are manufactured using a custom-built TSMC 4NP process. All NVIDIA Blackwell products feature two reticle-limited dies connected by a 10-TB\/s chip-to-chip interconnect in a unified single GPU.\nNVIDIA Grace CPU\nThe NVIDIA Grace CPU is a breakthrough processor designed for modern data centers running AI, vRAN, cloud, and high-performance computing (HPC) applications. It provides outstanding performance and memory bandwidth with 2x the energy efficiency of today’s leading server processors.\nNVLink2 C2C\nThe GB200 NVL2 platform uses NVLink-C2C for a groundbreaking 900 GB\/s interconnect between each NVIDIA Grace CPU and NVIDIA Blackwell GPU. Combined with fifth-generation NVLink, this delivers a massive 1.4-TB coherent memory model, fueling accelerated AI and vRAN performance.\nFifth-generation NVIDIA NVLink\nTo fully harness the power of exascale computing and trillion-parameter AI models, every GPU in a server cluster must communicate seamlessly and swiftly.\nFifth-generation NVLink is a high-performance interconnect to deliver accelerated performance from the GB200 NVL2 platform.\nKey-value caching\nKey-value (KV) caching\nimproves LLM response speeds by storing conversation context and history.\nGB200 NVL2 optimizes KV caching through its fully coherent NVIDIA Grace GPU and NVIDIA Blackwell GPU memory connected by NVLink-C2C, 7x faster than PCIe. This enables LLMs to predict words faster than x86-based GPU implementations.\nMGX reference architecture\nMGX GB200 NVL2 is a 2:2 configuration with CPU C-Links and GPU NVLinks connected​.\nHPM contains the following components:\nNVIDIA Grace CPUs (2)\nConnectors for GPU pucks and I\/O cards\nGPU modules populated in 2U AC Server (2)\nEach pluggable GPU module contains the GPU, B2B connection, and NVLink connectors.\nFigure 2. NVIDIA GB200 NVL2 platform layout\nGPU Compute\n40 PFLOPS FP4 | 20 PFLOPS FP8\/FP6\n10x GH200\nGPU Memory\nUp to 384 GB\nCPU\n144 Core ARMv9,\n960 GB LPDDR5,\n1.4x perf & 30% lower power than 2x SPR\nCPU to GPU\nNVLink C2C\nPer GPU 900 GB\/s bi-dir. & cache-coherent\nGPU to GPU\nNVLink\n1,800 GB\/s bi-dir., NVLink\nScale-Out\nSpectrum-X Ethernet or InfiniBand Connect-X or BlueField\nOS\nSingle OS with unified address space covering 2 CPU + 2 GPU\nSystem Power\nFull System ~3,500W, configurable\nSchedule\nSample: Q4 2024\nMP: Q1 2025\nTable 1. GB200 NVL2 platform features\nReal-time mainstream LLM inference\nThe GB200 NVL2 platform introduces massive coherent memory up to 1.3 TB shared between two NVIDIA Grace CPUs and two NVIDIA Blackwell GPUs. This shared memory is coupled with fifth-generation NVIDIA NVLink and high-speed, chip-to-chip (C2C) connections to deliver 5x faster real-time LLM inference performance for mainstream language models, such as Llama3-70B.\nWith an input sequence length of 256, an output sequence length of 8000, FP4 precision, the GB200 NVL2 platform can produce up to 25K tokens\/sec, which is 2.16B tokens\/day.\nFigure 3 shows how GB200 NVL2 performs when supporting AI and RAN workloads.\nFigure 3. Compute utilization for RAN and AI in GB200 NVL2\nHere’s what platform tenancy looks like for RAN and AI on the GB200 NVL2 platform:\nWorkload at 100% utilization\nRAN:\n~36x 100 MHz 64T64R\n*Tokens:\n25K tokens\/sec\nAI:\n~$10\/hr. | ~$90K\/year\nWorkload at 50:50 split utilization\nRAN:\n~18x 100 MHz 64T64R\n*Tokens:\n12.5K tokens\/sec\nAI:\n~$5\/hr. | ~$45K\/year\n*Token AI workload: Llama-3-70B FP4 | Sequence lengths input 256 \/ output 8K\nSupporting hardware for Aerial RAN Computer-1\nNVIDIA BlueField-3 and NVIDIA networking Spectrum-X are the supporting hardware for Aerial RAN Computer-1.\nNVIDIA BlueField-3\nNVIDIA BlueField-3\nDPUs enable real-time data transmission with precision 5G timing required for fronthaul eCPRI traffic.\nNVIDIA offers a full IEEE 1588v2 Precision Time Protocol (PTP) software solution. NVIDIA PTP software solutions are designed to meet the most demanding PTP profiles. NVIDIA BlueField-3 incorporates an integrated PTP hardware clock (PHC) that enables the device to achieve sub-20 nanosecond accuracy while offering timing-related functions, including time-triggered scheduling and time-based, software-defined networking (SDN) accelerations.\nThis technology also enables software applications to transmit fronthaul, RAN-compatible data in high bandwidth.\nNVIDIA networking Spectrum-X\nThe edge and data center networks play a crucial role in driving AI and wireless advancements and performance, serving as the backbone for distributed AI model inference, generative AI, and world-class vRAN performance.\nNVIDIA BlueField-3 DPUs enable efficient scalability across hundreds and thousands of NVIDIA Blackwell GPUs for optimal application performance.\nThe\nNVIDIA Spectrum-X\nEthernet platform is designed specifically to improve the performance and efficiency of Ethernet-based AI clouds and includes all the required functionality for 5G timing synchronization. It delivers 1.6x better AI networking performance compared to traditional Ethernet, along with consistent, predictable performance in multi-tenant environments.\nWhen Aerial RAN Computer-1 is deployed in a rack configuration, the Spectrum-X Ethernet switch serves as a dual-purpose fabric. It handles both fronthaul and AI (east-west) traffic on the compute fabric, while also carrying backhaul or midhaul and AI (north-south) traffic on the converged fabric. The remote radio units terminate at the switch in compliance with the eCPRI protocol.\nSoftware stacks on Aerial RAN Computer-1\nThe key software stacks on Aerial RAN Computer-1 include the following:\nNVIDIA Aerial CUDA-Accelerated RAN\nNVIDIA AI Enterprise and NVIDIA NIM\nNVIDIA Cloud Functions\nNVIDIA Aerial CUDA-Accelerated RAN\nNVIDIA Aerial CUDA-Accelerated RAN\nis the primary NVIDIA-built RAN software for 5G and private 5G running on Aerial RAN Computer-1.\nIt includes NVIDIA GPU-accelerated interoperable PHY and MAC layer libraries that can be easily modified and seamlessly extended with AI components. These hardened RAN software libraries can also be used by other software providers, telcos, cloud service providers (CSPs), and enterprises for building custom commercial-grade, software-defined 5G and future 6G radio access networks (RANs).\nAerial CUDA-Accelerated RAN is integrated with\nNVIDIA Aerial AI Radio Frameworks\n, which provides a package of AI enhancements to enable training and inference in the RAN using the framework tools—pyAerial, NVIDIA Aerial Data Lake, and\nNVIDIA Sionna\n.\nIt is also complemented by\nNVIDIA Aerial Omniverse Digital Twin\n, a system-level network digital twin development platform that enables physically accurate simulations of wireless systems.\nNVIDIA AI Enterprise and NVIDIA NIM\nNVIDIA AI Enterprise\nis the software platform for enterprise generative AI.\nNVIDIA NIM\nis a collection of microservices that simplify the deployment of foundation models for generative AI applications.\nCollectively, they provide easy-to-use microservices and blueprints that accelerate data science pipelines and streamline the development and deployment of production-grade co-pilots and other generative AI applications for enterprises.\nEnterprises and telcos can either subscribe to the managed NVIDIA Elastic NIM service or deploy and manage NIM themselves. Aerial RAN Computer-1 can host NVIDIA AI Enterprise and NIM-based AI and generative AI workloads.\nNVIDIA Cloud Functions\nNVIDIA Cloud Functions\noffers a serverless platform for GPU-accelerated AI workloads, ensuring security, scalability, and reliability. It supports various communication protocols:\nHTTP polling\nStreaming\ngRPC\nCloud Functions is primarily suited for shorter running, preemptable workloads, such as inferencing and fine-tuning. This is well-suited for the Aerial RAN Computer-1 platform as the RAN workload resource utilization varies over time of the day.\nThe AI workloads that are ephemeral and preemptable can usually fill up those under-used hours of the day, which maintains high utilization of the Aerial RAN Computer-1 platform.\nDeployment options and performance\nAerial RAN Computer-1 has multiple deployment options that include all points in the radio access network:\nRadio base station cell site\nPoint of presence locations\nMobile switching offices\nBaseband hotels\nFor private 5G, it can be located on the enterprise premises.\nAerial RAN Computer-1 can support various configurations and locations, including private, public, or hybrid cloud environments while using the same software regardless of location or interface standard. This ability offers unprecedented flexibility compared to traditional single-purpose RAN computers.\nThe solution also supports a wide range of network technologies:\nOpen Radio Access Network (Open-RAN) architectures\nAI-RAN\n3GPP standards\nOther industry-leading specifications\nAerial RAN Computer-1, based on GB200, delivers continued performance improvements in RAN processing, AI processing, and energy efficiency compared to the earlier NVIDIA H100 and NVIDIA H200 GPUs (Figure 4).\nThe GB200 NVL2 platform provides a single MGX server for existing infrastructure, which is easy to deploy and scale out. You get mainstream LLM inference and data processing with high-end RAN compute.\nFigure 4. GB200 NVL2 performance compared to previous generations\nConclusion\nAI-RAN will revolutionize the telecom industry, enabling telcos to unlock new revenue streams and deliver enhanced experiences through generative AI, robotics, and autonomous technologies. The NVIDIA AI Aerial platform implements AI-RAN, aligning it with NVIDIA’s broader vision to make wireless networks AI-native.\nWith Aerial RAN Computer-1, telcos can deploy AI-RAN on a common infrastructure today. You can maximize the utilization by running RAN and AI workloads concurrently and improve RAN performance with AI algorithms.\nMost importantly, with this common computer, you can tap into a completely new opportunity to become the AI fabric of choice for enterprises that need local computing and data sovereignty for their AI workloads. You can start with an AI-first approach and RAN next, with a software upgrade, starting the clock on maximizing ROI from day one.\nT-Mobile and SoftBank have already announced their plans to commercialize AI-RAN together with leading RAN software providers, using hardware and software components of NVIDIA AI Aerial.\nAt Mobile World Congress, Americas, Vapor IO and the City of Las Vegas announced the\nworld’s first private 5G AI-RAN deployment\nusing NVIDIA AI Aerial.\nWe are at a turning point in transforming wireless networks for AI, with AI. Join us at the\nNVIDIA AI Summit\nin Washington, D.C. and at the\nNVIDIA 6G Developer Day\nto learn more about NVIDIA Aerial AI and NVIDIA Aerial RAN Computer-1.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/bringing-ai-ran-to-a-telco-near-you\/","jp_title":"通信会社に AI-RAN を提供","jp_content":"Reading Time:\n5\nminutes\n生成 AI と AI エージェントの推論により、エッジ���らセントラル クラウドまで AI コンピューティング インフラストラクチャを分散する必要性が高まります。\nIDC は\n、「ビジネス AI (消費者を除く) は、2030 年までに世界経済に 19.9 兆ドルの貢献をし、GDP の 3.5% を占めるようになる」と予測しています。\n5G ネットワークも、この新しい AI トラフィックに対応するために進化しなければなりません。 同時に、通信事業者には、データのプライバシーと主権の要件を満たしながら、ネットワーク接続に依存せずにエンタープライズ AI ワークロードをホストするためのローカル AI コンピューティング インフラストラクチャになる機会があります。 ここで、無線信号処理と AI ワークロードの両方を高速化する機能を備えた高速コンピューティング インフラストラクチャが活躍します。 そして最も重要なのは、同じコンピューティング インフラストラクチャを使用して AI サービスと無線アクセス ネットワーク (RAN) サービスの処理が可能であることです。 この組み合わせは、\n通信業界では AI-RAN\nと呼ばれています。\nNVIDIA は、世界初の AI-RAN 展開プラットフォームである Aerial RAN Computer-1 を導入し、共通のアクセラレーテッド インフラストラクチャで AI と RAN のワークロードを同時にサービスできます。\nまた、\nT-Mobile による AI-RANイノベーション センター\nの立ち上げに続き、Aerial RAN Computer-1 は、通信会社が世界中で採用できるプラットフォームで AI-RAN を現実のものにします。 小規模、中規模、大規模の構成で使用でき、セルサイト、分散型または集中型のサイトで展開して、ネットワークを音声、ビデオ、データ、AIトラフィックに対応する多目的インフラストラクチャに効果的に変えることができます。\nこれは、AI を活用した AI のためのワイヤレス ネットワークの概念を再構築する変革的なソリューションです。 また、通信事業者にとっては、分散ネットワーク インフラストラクチャ、低遅延、保証されたサービス品質、大規模なスケール、データのプライバシー、セキュリティ、ローカリゼーションの維持能力など、AI 推論とエージェント AI アプリケーションの重要な要件を活用して、AI フライホイールを活性化する大きなチャンスでもあります。\nAI-RAN、AI Aerial、および Aerial RAN Computer-1\nAI-RAN は、AI ネイティブな多目的ネットワークを構築するためのテクノロジ フレームワークです。 通信会社が AI-RAN を採用し、従来の単一 ASIC ベースの RAN コンピューティング ネットワークから、RAN と AI の両方に対応する新しい多目的アクセラレーテッド コンピューティング ベースのネットワークに移行するにつれて、通信会社は新しい AI エコノミーに参加し、AI を活用してネットワークの効率を向上できます。\nNVIDIA AI Aerial\nには、AI-RAN ベースの 5G および 6G ワイヤレス ネットワークを設計、シミュレーション、トレーニング、展開する 3 つのコンピューター システムが含まれています。 Aerial RAN Computer-1 は、NVIDIA AI Aerial の基盤であり、AI-RAN の商業グレードのプラットフォームを提供します。\nAerial RAN Computer-1 (図 1) は、ソフトウェア デファインド 5G、NVIDIA またはその他の RAN ソフトウェア プロバイダーのプライベート 5G RAN、コンテナー化されたネットワーク機能、NVIDIA またはパートナーのAI マイクロサービス、内部およびサードパーティの生成 AI アプリケーションをホストするなど、RAN と AI ワークロードを実行するための共通の拡張可能なハードウェア基盤を提供します。 Aerial RAN Computer-1 はモジュール式の設計であり、D-RAN から C-RAN アーキテクチャまで拡張でき、郊外から密集した都市部まで幅広いユース ケースに対応します。\nNVIDIA CUDA-X ライブラリは、アクセラレーテッド コンピューティングの中心であり、効率の向上に加え、速度、精度、信頼性を提供します。 つまり、同じパワー エンベロープでより多くの作業が行われるということです。 最も重要なのは、通信通信事業固有の適応を含むドメイン固有のライブラリが、Aerial RAN Computer-1 を通信事業の展開に適したものにする上で重要です。\nNVIDIA DOCA\nは、RDMA、PTP\/タイミング同期、イーサネットベースのフロントホール (eCPRI) などの通信ワークロードや、最新のネットワーク インフラストラクチャに不可欠な AI ワークロードのパフォーマンスを大幅に向上できるツールとライブラリのスイートを提供します。\n総合的に、フルスタックにより、スケーラブルなハードウェア、共通ソフトウェア、オープン アーキテクチャが実現し、エコシステムパートナーと協力して高性能な AI-RAN を提供できます。\n図 1. NVIDIA AI Aerial プラットフォームの一部としての NVIDIA Aerial RAN Computer-1\nAerial RAN Computer-1 の利点\nAerial RAN Computer-1 により、ワイヤレス ネットワークは、AI と RAN データ センターの大規模な分散グリッドに変身し、ソフトウェアのアップグレードにより 6G の道を開きつ、通信会社にとって新しい収益化の道を開きます。\n通信サービス プロバイダー向け Aerial RAN Computer-1 の利点には、次のものがあります。\nAI および生成 AI アプリケーション、エッジでの AI 推論、または GPU-as-a-Service を使用して収益化します。\n現在は通常 30% しか利用されていない単目的基地局と比較して、インフラストラクチャの使用率を 2 ~ 3 倍に向上します。 同じインフラストラクチャを使用して、内部生成 AI ワークロードや、UPF や RIC などのコンテナー化されたネットワーク機能をホストできます。\nサイト固有の AI 学習を通じて無線ネットワークのパフォーマンスを向上させ、スペクトル効率を最大 2 倍向上できます。 これは、取得スペクトラムの Mhz あたりの直接コストを削減することを意味します。\nあらゆるインタラクションに AI を組み込む次世代アプリケーションに、高性能 RAN と AI 体験を提供します。 Aerial RAN Computer-1 は、RAN のみモードで最大 170 Gb\/s のスループットと、AI のみモードで 25K トークン\/秒、または両方の組み合わせてサービスを提供でき、従来のネットワークと比較して優れたパフォーマンスを発揮できます。\nAerial RAN Computer-1 の構成要素\nAerial RAN Computer-1 の主要なハードウェア コンポーネントには、以下が含まれます。\nNVIDIA GB200 NVL2\nNVIDIA Blackwell GPU\nNVIDIA Grace CPU\nNVLink2 C2C\n第 5 世代 NVIDIA NVLink\nKey-value caching\nMGX リファレンス アーキテクチャ\nリアルタイム 主流 LLM 推論\nNVIDIA GB200 NVL2\nAerial RAN Computer-1 で使用される NVIDIA GB200 NVL2 プラットフォーム (図 2) は、データ センターとエッジ コンピューティングに革命をもたらし、主流の大規模言語モデル (LLM)、vRAN、ベクター データベース検索、データ処理で比類のないパフォーマンスを提供します。\n2 つの NVIDIA Blackwell GPU との NVIDIA Grace CPU を搭載したこのスケールアウトのシングルノード アーキテクチャは、アクセラレーテッド コンピューティングを既存のインフラストラクチャにシームレスに統合します。\nこの汎用性により、広範囲のシステム設計とネットワーキング オプションが可能になり、GB200 NVL2 プラットフォームは、AI の力を活用したいデータ センター、エッジ、セルサイトの場所に理想的な選択肢となります。\nたとえば、GB200 サーバーの半分を RAN タスクに割り当てられ、残りの半分は単一セルサイトで\nマルチインスタンス GPU (MIG)\nテクノロジを通じて AI 処理に割り当てることができます。 集約サイトでは、完全な GB200 サーバーを RAN に専用し、もう 1 つを AI 専用に使用できます。 集中型の展開では、GB200サーバーのクラスターをRANとAIワークロード間で共有できます。\nNVIDIA Blackwell GPU\nNVIDIA Blackwell は、パフォーマンス、効率、拡張性の向上を実現する革命的なアーキテクチャです。 NVIDIA Blackwell GPU は 208Bトランジスタをパックし、カスタム構築されたTSMC 4NP プロセスを使用して製造されています。 すべての NVIDIA Blackwell 製品には、統一された単一 GPU で 10 TB\/s のチップ間相互接続により接続された 2 つのレチクル制限付きダイが特徴です。\nNVIDIA Grace CPU\nNVIDIA Grace CPU は、AI、vRAN、クラウド、ハイパフォーマンス コンピューティング (HPC) アプリケーションを実行する最新のデータ センター向けに設計された画期的なプロセッサです。 優れたパフォーマンスとメモリ帯域幅を提供し、現在の主要なサーバー プロセッサの 2 倍のエネルギー効率で、優れたパフォーマンスとメモリ帯域幅を提供します。\nNVLink2 C2C\nGB200 NVL2 プラットフォームは、NVLink-C2C を使用して、各 NVIDIA Grace CPU と NVIDIA Blackwell GPU の間で 900 GB\/s の相互接続を実現します。 第5世代 NVLink と組み合わせると、1.4 TB の巨大なコヒーレント メモリ モデルが提供され、AI と vRAN のパフォーマンスを加速します。\n第 5 世代 NVIDIA NVLink\nエクサスケール コンピューティングと 1 兆パラメーターの AI モデルのパワーを最大限に活用するには、サーバー クラスター内のすべての GPU がシームレスかつ迅速に通信する必要があります。\n第5世代 NVLink は、GB200 NVL2 プラットフォームから高速なパフォーマンスを実現する高性能相互接続です。\nKey-value caching\nキー値 (KV) キャッシュは、\n会話のコンテキストと履歴を保存することで、LLM の応答速度を向上します。\nGB200 NVL2 は、NVLink-C2C で接続された完全にコヒーレントな NVIDIA Grace GPU と NVIDIA Blackwell GPU メモリを通じて KV キャッシュを最適化し、PCIe よりも 7 倍高速です。 これにより、LLM は、x86 ベースの GPU 実装よりも速く単語を予測できます。\nMGX リファレンス アーキテクチャ\nMGX GB200 NVL2 は、CPU C-Link と GPU NVLink が接続された 2:2 構成です。\nHPM には、次のコンポーネントが含まれています。\nNVIDIA Grace CPU (2)\nGPU パックと I\/O カード用のコネクター\n2U AC Server に搭載された GPU モジュール (2)\n各プラグ可能な GPU モジュールには、GPU、B2B 接続、NVLink コネクターが含まれています。\n図 2. NVIDIA GB200 NVL2 プラットフォーム レイアウト\nGPU コンピューティング\n40 PFLOPS FP4 | 20 PFLOPS FP8\/FP6\n10x GH200\nGPU メモリ\n最大 384 GB\nCPU\n144 コア ARMv9、\n960 GB LPDDR5、\n2x SPR と比較して 1.4 倍のパフォーマンスと 30% の電力削減\nCPU から GPU\nNVLink C2C\nGPU あたりの900 GB\/s bi-dir.とキャッシュコヒーレント\nGPU から GPU\nNVLink\n1,800 GB\/s bi-dir.、NVLink\nスケールアウト\nSpectrum-X イーサネット、InfiniBand Connect-X、BlueField\nOS\n2 CPU + 2 GPU をカバーする統一アドレス空間を持つ単一 OS\nシステム パワー\nフル システム ~3,500W、構成可能\nスケジュール\nサンプル: Q4 2024 四半期\nMP: 第1 Q1 2025\n表 1. GB200 NVL2 プラットフォーム機能\nリアルタイム 主流 LLM 推論\nGB200 NVL2 プラットフォームは、2 つの NVIDIA Grace CPU と 2 つの NVIDIA Blackwell GPU で共有される最大 1.3 TB の巨大な整合メモリを導入します。 この共有メモリは、第 5 世代 NVIDIA NVLink と高速チップ間 (C2C) 接続と組み合わせて、Llama3-70B などの主流言語モデルで 5 倍高速なリアルタイム LLM 推論パフォーマンスを実現します。\n入力シーケンス長 256 、出力シーケンス長 8000 の出力シーケンス長、FP4 の精度により、GB200 NVL2 プラットフォームは最大 25K トークン\/秒(2.16B トークン\/日)を生成できます。\n図 3 は、AI と RAN ワークロードをサポートする場合に GB200 NVL2 のパフォーマンスを示します。\n図 3. GB200 NVL2 における RAN と AI のコンピューティング使用率\nGB200 NVL2 プラットフォームで RAN と AI のプラットフォーム テナンスの様子は、次のとおりです。\n100% 使用率のワークロード\nRAN:\n~36x 100 MHz 64T64R\n*トークン:\n25K トークン\/秒\nAI:\n~10ドル\/時 | ~9 万ドル\/年\n50:50 分割使用率でのワークロード\nRAN:\n~18x 100 MHz 64T64R\n*トークン:\n12.5K トークン\/秒\nAI:\n~5ドル\/時間。 | ~45,000 ドル\/年\n*トークン AI ワークロード: Llama-3-70B FP4 | シーケンス長入力 256 \/ 出力 8K\nAerial RAN Computer-1 のサポート ハードウェア\nNVIDIA BlueField-3 と NVIDIAネットワーキング Spectrum-X は、Aerial RAN Computer-1 のサポートハードウェアです。\nNVIDIA BlueField-3\nNVIDIA BlueField-3 DPU\nは、フロントホール eCPRI トラフィックに必要な正確な 5G タイミングでリアルタイム データ伝送を可能にします。\nNVIDIA は、完全な IEEE 1588v2 Precision Time Protocol (PTP) ソフトウェア ソリューションを提供します。 NVIDIA PTP ソフトウェア ソリューションは、最も要求の厳しい PTP プロファイルに対応するように設計されています。 NVIDIA BlueField-3 には統合 PTP ハードウェア クロック (PHC) が組み込まれており、時間トリガーのスケジューリングや時間ベースのソフトウェア デファインド ネットワーキング (SDN) 加速などのタイミング関連機能を提供しながら、デバイスが 20 ナノ秒未満の精度を実現できます。\nこのテクノロジは、ソフトウェア アプリケーションがフロントホール、RAN 互換性のデータを高帯域幅で送信することを可能にします。\nNVIDIA ネットワーキング Spectrum-X\nエッジおよびデータセンター ネットワークは、AI とワイヤレスの進歩とパフォーマンスを推進する上で重要な役割を果たし、分散 AI モデル推論、生成 AI、世界クラスの vRAN パフォーマンスのバックボーンとして機能します。\nNVIDIA BlueField-3 DPUは、数百万台の NVIDIA Blackwell GPU で効率的な拡張性を実現し、最適なアプリケーション パフォーマンスを実現します。\nNVIDIA Spectrum-X\nイーサネット プラットフォームは、イーサネット ベースの AI クラウドのパフォーマンスと効率を向上させるために特別に設計されており、5G タイミング同期に必要なすべての機能が含まれています。 従来のイーサネットと比較して 1.6 倍の AI ネットワーキング パフォーマンスを実現し、マルチテナント環境で一貫した予測可能なパフォーマンスを実現します。\nAerial RAN Computer-1 がラック構成で展開される場合、Spectrum-X イーサネット スイッチは 2 つの目的を持つファブリックとして機能します。 コンピューティング ファブリックでフロントホールと AI (イーストウエスト) トラフィックの両方を処理し、コンバージ ファブリックでバックホールまたはミッドホールと AI (ノースサウス) トラフィックも搬送します。 リモート 無線ユニットは、eCPRI プロトコルに準拠してスイッチで終了します。\nAerial RAN Computer-1 上のソフトウェア スタック\nAerial RAN Computer-1 の主要なソフトウェア スタックには、以下が含まれます。\nNVIDIA Aerial CUDA-Accelerated RAN\nNVIDIA AI Enterprise と NVIDIA NIM\nNVIDIA Cloud Functions\nNVIDIA Aerial CUDA-Accelerated RAN\nNVIDIA Aerial CUDA-Accelerated RAN\nは、Aerial RAN Computer-1 上で実行される 5G とプライベート 5G 向けに NVIDIA が構築した主要 RAN ソフトウェアです。\nこれには、AI コンポーネントを使用して簡単に変更し、シームレスに拡張できる、NVIDIA GPU アクセラレーションの相互運用可能な PHY および MAC レイヤー ライブラリが含まれています。 これらの強化された RAN ソフトウェア ライブラリは、他のソフトウェア プロバイダー、通信会社、クラウド サービス プロバイダー (CSP)、カスタムの商用グレードのソフトウェア デファインド 5G および将来の 6G 無線アクセス ネットワーク (RAN) を構築するために企業でも使用できます。\nAerial CUDA-Accelerated RA は、\nNVIDIA Aerial AI Radio Frameworks\nと統合され、フレームワーク ツールである pyAerial、NVIDIA Aerial Data Lake、\nNVIDIA Sionna\nを使用して RAN のトレーニングと推論を可能に AI 強化パッケージを提供します。\nまた、ワイヤレス システムの物理的に正確なシミュレーションを可能にするシステム レベルのネットワーク デジタル ツイン開発プラットフォームである\nNVIDIA Aerial Omniverse Digital Twin\nが補完されています。\nNVIDIA AI Enterprise と NVIDIA NIM\nNVIDIA AI Enterprise\nは、エンタープライズ生成 AI のためのソフトウェア プラットフォームです。\nNVIDIA NIM\nは、生成 AI アプリケーションのための基盤モデルの展開を簡素化するマイクロサービスのコレクションです。\n全体的に、これらの製品は、データ サイエンスのパイプラインを高速化し、企業向けの本番環境グレードのコ パイロットやその他の生成 AI アプリケーションの開発とデプロイを合理化する使いやすいマイクロサービスとブループリントを提供します。\n企業と通信会社は、マネージド NVIDIA Elastic NIM サービスに登録するか、NIM を自ら展開し管理できます。 Aerial RAN Computer-1 は、NVIDIA AI Enterprise、NIM ベースの AI および生成 AI ワークロードをホストできます。\nNVIDIA Cloud Functions\nNVIDIA Cloud Functions\nは、GPU アクセラレーテッド AI ワークロードのためのサーバーレス プラットフォームを提供し、セキュリティ、拡張性、信頼性を確保します。. さまざまな通信プロトコルをサポートします。\nHTTP polling\nストリーミング\ngRPC\nCloud Functions は、主に推論やファインチューニングなど、実行時間が短い、事前処理可能なワークロードに適しています。 RAN ワークロード リソース使用率が 1 日の時間とともに変化するため、Aerial RAN Computer-1 プラットフォームに最適です。\n一時的に先占可能な AI ワークロードは、通常、1 日の使用されていない時間を埋めることができ、Aerial RAN Computer-1 プラットフォーム���高使用率を維持します。\n展開のオプションとパフォーマンス\nAerial RAN Computer-1 には、無線アクセス ネットワークのすべてのポイントを含む複数の展開のオプションがあります。\n無線基地局セルサイト\n拠点の場所\n移動式スイッチング オフィス\nベースバンド ホテル\nプライベート 5G の場合は、企業の敷地内に設置できます。\nAerial RAN Computer-1 は、場所やインターフェイス標準に関係なく同じソフトウェアを使用しながら、プライベート、パブリック、ハイブリッド クラウド環境など、さまざまな構成と場所をサポートできます。 この機能は、従来の単一目的 RAN コンピューターと比較して前例のない柔軟性を提供します。\nこのソリューションは、広範囲のネットワーク テクノロジもサポートしています。\nオープン無線アクセス ネットワーク (Open-RAN) アーキテクチャ\nAI-RAN\n3GPP 標準\nその他の業界をリードする仕様\nGB200 をベースとする Aerial RAN Computer-1 は、以前の NVIDIA H100 と NVIDIA H200 GPU と比較して、RAN 処理、AI 処理、エネルギー効率のパフォーマンスが継続的に向上します (図 4)。\nGB200 NVL2 プラットフォームは、既存のインフラストラクチャに 1 つの MGX サーバーを提供し、展開と拡張が容易です。 ハイエンド RAN コンピューティングで主流の LLM 推論とデータ処理を実現します。\n図 4. GB200 NVL2 パフォーマンスと従来世代比較\nまとめ\nAI-RAN は、通信業界に革命をもたらし、通信会社が新しい収益源を獲得し、生成 AI、ロボティクス、自律テクノロジを通じて強化された体験を提供することを可能にします。 NVIDIA AI Aerial プラットフォームは、AI-RAN を実装し、ワイヤレス ネットワークを AI ネイティブにすることという NVIDIA の広範なビジョンと一致しています。\nAerial RAN Computer-1 により、通信会社は今日、共通のインフラストラクチャに AI-RAN を展開できます。 RAN と AI ワークロードを同時に実行することで使用率を最大化し、AI アルゴリズムで RAN のパフォーマンスを向上できます。\n最も重要なのは、この共通コンピューターを使用すると、AI ワークロードにローカル コンピューティングとデータ主権を必要とする企業にとって最適な AI ファブリックになるというまったく新しい機会を活用できることです。 AI ファーストのアプローチから始めて、次にソフトウェア アップグレードで RAN を実施すれば、初日から ROI を最大化するための取り組みを開始できます。\nT-Mobile とソフトバンクは、NVIDIA AI Aerial のハードウェアとソフトウェア コンポーネントを使用して、主要な RAN ソフトウェア プロバイダーと AI-RAN を商業化する計画を発表しました。\nMobile World Congress で、アメリカ、Vapor IO とラスベガス市は、NVIDIA AI Aerial を使用した\n世界初のプライベート 5GAI-RAN デプロイ\nを発表しました。\n私たちは、AI による AI のためのワイヤレス ネットワークの変革の転換点にいます。 ワシントンD.C. で開催される\nNVIDIA AI Summit\nと\nNVIDIA 6G Developer Day\nにぜひ参加して、NVIDIA Aerial AI と NVIDIA Aerial RAN Computer-1 について詳しく学んでください。\n関連情報\nGTC セッション:\n通信会社が国家 AI インフラストラクチャとプラットフォームをどのように実現するか\nGTC セッション:\nAI-RAN と 6G 研究の民主化\nGTC セッション:\n現代の通信会社 Blueprint: AI を使用して変革と再発明\nSDK:\nAerial Omniverse デジタル ツイン\nウェビナー:\nHow Telcos Transform Customer Experiences with Conversational AI\nウェビナー:\n多言語音声 AI カスタマイズされたエージェント アシストで通信会社 コンタクト センター エージェントの強化"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/accelerate-large-linear-programming-problems-with-nvidia-cuopt\/","en_title":"Accelerate Large Linear Programming Problems with NVIDIA cuOpt","en_content":"The evolution of linear programming (LP) solvers has been marked by significant milestones over the past century, from\nSimplex\nto the\ninterior point method (IPM)\n. The introduction of\nprimal-dual linear programming (PDLP)\nhas brought another significant advancement.\nNVIDIA cuOpt\nhas now implemented PDLP with GPU acceleration. Using cutting-edge algorithms, NVIDIA hardware, dedicated CUDA features, and NVIDIA GPU libraries, the cuOpt LP solver achieves over 5,000x faster performance compared to CPU-based solvers.\nThis post examines the key components of LP solver algorithms, GPU acceleration in LP, and cuOpt performance on\nMittelmann’s benchmark\nand\nMin Cost Flow problem\ninstances.\nHarnessing cutting-edge innovations for large-scale LP\nLP is a method that involves optimizing a linear objective function, subject to a set of linear constraints.\nConsider this scenario: A farmer must decide which vegetables to grow and in what quantities to maximize profit, given limitations on land, seeds, and fertilizer. The goal is to determine the optimal revenue while respecting all constraints, as quickly as possible.\nNVIDIA developed an LLM agent\nexample that helps model the problem and solve it using an LP solver. LP is an essential tool for optimization and has applications in resource allocation, production planning, supply chain, and, as a backbone for\nmixed-integer programming\n(MIP) solvers. Solving mathematical problems with millions of variables and constraints in seconds is challenging, if not impossible, in some cases.\nThere are three requirements to solve LP problems efficiently on GPUs:\nEfficient and massively parallel algorithms\nNVIDIA GPU libraries and CUDA features\nCutting-edge NVIDIA GPUs\nEfficient and massively parallel algorithms\nSimplex\n, introduced by Dantzig in 1947, remains a core component of most LP and MIP solvers. It works by following the edges of the feasible region to find the optimum.\nFigure 1. Simplex method\n(Source:\nVisually Explained – What is Linear Programming (LP)?\n)\nThe next major advancement came with the\ninterior point method (IPM)\n, discovered by I. I. Dikin in 1967. IPM, which moves through the interior of the polytope towards the optimum, is now considered state-of-the-art for solving large-scale LPs on CPUs. However, both techniques face limitations in massive parallelization.\nFigure 2. Interior Point Method\n(Source:\nVisually Explained – What is Linear Programming (LP)?\n)\nIn 2021, a new groundbreaking technique to solve large LPs was introduced by the Google Research team:\nPDLP\n. It is a first-order method (FOM) that uses the derivative of the problem to iteratively optimize the objective and minimize constraint violation.\nFigure 3. Gradient descent\nPDLP enhances\nprimal-dual hybrid gradient (PDHG)\nalgorithm by introducing tools to improve convergence, including a presolver, diagonal preconditioning, adaptive restarting, and dynamic primal-dual step size selection. Presolving and preconditioning make the input problem simpler and improves numerical stability while restarting and dynamic step size computation enables the solver to adapt itself during optimization.\nA key advantage of FOM over previous methods is its ease of massive parallelization, making it well-suited for GPU implementation.\nPDLP employs two highly parallelizable computational patterns: Map operations and sparse matrix-vector multiplications (SpMV). This approach enables PDLP to efficiently handle millions of variables and constraints in parallel, making it extremely effective on GPUs.\nMap is extensively used in PDLP to perform additions, subtractions, and so on for all the variables and constraints that can span millions of elements. It is extremely parallel and efficient on GPUs.\nSpMV corresponds to multiplying a sparse matrix (containing many zeros) and a vector. While this matrix size can reach tens of billions, it contains far fewer useful values. For instance, in a vegetable planting problem, a constraint such as, “I can’t plant more than 3.5 kg of potatoes” would contain only one useful value among millions of variables.\nSpMV algorithms have been extensively optimized for GPUs, making them orders of magnitude faster than CPU implementations.\nNVIDIA GPU libraries and CUDA features\nTo have the best performance, our GPU PDLP implementation uses cutting-edge CUDA features and the following NVIDIA libraries:\ncuSparse\nThrust\nRMM\ncuSparse\nis the NVIDIA GPU-accelerated library for sparse linear algebra. It efficiently performs SpMVs, a challenging task on GPUs. cuSparse employs unique algorithms designed to fully leverage the NVIDIA massively parallel architecture.\nThrust is part of the\nNVIDIA CUDA Core Compute Libraries\n(CCCL) and provides high-level C++ parallel algorithms. It simplifies the expression of complex algorithms using patterns and iterators for GPU execution. I used Thrust for map operations and the restart process, which entails sorting values by key. This is a task that can be demanding on the GPU but is efficiently optimized by Thrust.\nRMM\nis the fast and flexible NVIDIA memory management system that enables the safe and efficient handling of GPU memory through the use of a memory pool.\nFinally, I took advantage of advanced CUDA features. One of the most significant challenges in parallelizing PDLP on GPUs is the restart procedure, which is inherently iterative and not suited for parallel execution. To address this, I used\nCUDA Cooperative Groups\n, which enable you to define GPU algorithms at various levels, with the largest being the grid that encompasses all workers. By implementing a cooperative kernel launch and using grid synchronization, you can efficiently and elegantly express the iterative restart procedure on the GPU.\nCutting-edge NVIDIA GPUs\nGPUs achieve fast computation by using thousands of threads to solve many problems in parallel. However, before processing, the GPU must first transfer the data from the main memory to its worker threads.\nMemory bandwidth\nrefers to the amount of data that can be transferred per second. While CPUs can usually handle hundreds of GB\/s, the latest GPU,\nNVIDIA HGX B100\n, has a bandwidth of eight TB\/s, two orders of magnitude larger.\nThe performance of this PDLP implementation scales directly with increased memory bandwidth due to its heavy reliance on memory-intensive computational patterns like Map and SpMV. With future NVIDIA GPU bandwidth increases, PDLP will automatically become faster, unlike other CPU-based LP solvers.\ncuOpt outperforms state-of-the-art CPU LP solvers on Mittelmann’s benchmark\nThe industry standard to benchmark the speed of LP solvers is\nMittelmann’s benchmark\n. The objective is to determine the optimal value of the LP function while adhering to the constraints in the shortest time possible. The benchmark problems represent various scenarios and contain between hundreds of thousands to tens of millions of values.\nFor the comparison, I ran a state-of-the-art CPU LP solver and compared it to this GPU LP solver. I used the same threshold of 10\n-4\nand disabled crossover. For more information, see the\nPotential for PDLP refinement\nsection later in this post.\nBoth solvers operated under\nfloat64\nprecision.\nFor the CPU LP solver, I used a recommended CPU setup: AMD EPYC 7313P servers with 16 cores and 256 GB of DDR4 memory.\nFor the cuOpt LP solver, I used an NVIDIA H100 SXM Tensor Core GPU to benefit from the high bandwidth and ran without presolve.\nI considered the full solve time without I\/O, including scaling for both solvers and presolving for the CPU LP solver. Only instances that have converged for both solvers with a correct objective value are showcased in Figure 4. cuOpt is faster on 60% of the instances and more than 10x faster in 20% of the instances. The biggest speed-up is 5000x on one instance of a large multi-commodity flow optimization problem.\nFigure 4. cuOpt acceleration compared to CPU LP on Mittelmann’s benchmark\nI also compared cuOpt against a state-of-the-art CPU PDLP implementation using the same setup and conditions. cuOpt is consistently faster and between 10x to 3000x faster.\nFigure 5. cuOpt acceleration compared to a CPU PDLP implementation on Mittelmann’s benchmark\nThe multi-commodity flow problem (MCF) involves finding the most efficient way to route multiple different types of goods through a network from various starting points to their respective destinations, ensuring that the network’s capacity constraints are not exceeded. One way to solve an MCF problem is to convert it to an LP. On a set of large MCF instances, PDLP is consistently faster, between 10x and 300x.\nFigure 6. cuOpt acceleration compared to the CPU LP solver on a set of MCF instances\nPotential for PDLP refinement\nThe NVIDIA cuOpt LP solver delivers incredible performance, but there’s potential for future enhancements:\nHandling higher accuracy\nRequiring high bandwidth\nConvergence issues on some problems\nLimited benefit for small LPs\nHandling higher accuracy\nTo decide whether you’ve solved an LP, you measure two things:\nOptimality gap:\nMeasures how far you are from finding the optimum of the objective function.\nFeasibility:\nMeasures how far you are from respecting the constraints.\nAn LP is considered solved when both quantities are zero. Reaching an exact value of zero can be challenging and often unnecessary, so LP solvers use a threshold that enables faster convergence while maintaining accuracy. Both quantities are now only required to be below this threshold, which is relative to the magnitude of the values of the problem.\nMost LP solvers use a threshold, especially for large problems that are extremely challenging to solve. The industry standard so far was to use 10\n-8.\nWhile PDLP can solve problems using 10\n-8\n, it is then usually significantly slower. This can be an issue if you require high accuracy. In practice, many find 10\n-4\naccurate enough and sometimes even lower. This heavily benefits PDLP while not being a big differentiator for other LP-solving algorithms.\nRequiring high bandwidth\nPDLP’s performance scales linearly with memory bandwidth, making it more efficient on new GPU architectures. It requires a recent server-grade GPU to reproduce the results shown in the performance analysis section.\nConvergence issues on some problems\nWhile PDLP can solve most LPs quickly, it sometimes needs a significant number of steps to converge, resulting in higher runtimes. On Mittelmann’s benchmark, cuOpt LP Solver times out after one hour on 8 of the 49 public instances, due to a slow convergence rate.\nLimited benefit for small LPs\nSmall LPs benefit less from the GPU’s high bandwidth, which doesn’t enable PDLP to scale as well compared to CPU solvers. The cuOpt LP solver offers a batch mode for this scenario where you can provide and solve hundreds of small LPs in parallel.\nConclusion\nThe cuOpt LP solver uses CUDA programming, NVIDIA GPU libraries, and cutting-edge NVIDIA GPUs to solve LPs, potentially orders of magnitude faster than CPU and scaling to over a billion coefficients. As a result, it’s particularly beneficial for tackling large-scale problems, where its advantages become even more prominent.\nSome use cases will still work better with traditional Simplex or IPM and I expect the future solvers to be a combination of GPU and CPU techniques.\nSign up to be notified when you can\ntry the cuOpt LP\n. Try NVIDIA\ncuOpt Vehicle Routing Problem (VRP\n) today with\nNVIDIA-hosted NIM\nmicroservices for the latest AI models for free on the\nNVIDIA API Catalog\n.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/accelerate-large-linear-programming-problems-with-nvidia-cuopt\/","jp_title":"NVIDIA cuOpt で大規模な線形計画問題を加速する","jp_content":"Reading Time:\n3\nminutes\n線形計画法 (LP: Linear Programming) ソルバーの進化は、\nシンプレックス法\nから\n内点法 (IPM: Interior Point Method)\nまで、過去 1 世紀にわたってに重要な節目で特徴づけられてきました。\n主双対線形計画法 (PDLP: Primal-dual Linear Programming)\nの導入は、さらなる大きな進歩をもたらしました。\nNVIDIA cuOpt\nは現在、GPU アクセラレーションで PDLP を実装しています。最先端のアルゴリズム、NVIDIA ハードウェア、専用の CUDA 機能、NVIDIA GPU ライブラリを使用して、cuOpt LP ソルバーは、CPU ベースのソルバーと比較して 5,000 倍以上の高速パフォーマンスを実現しています。\nこの投稿では、LP ソルバー アルゴリズムの主要コンポーネント、LP における GPU アクセラレーション、\nMittelmann のベンチマーク\nと\n最小費用フロー問題\nのインスタンスにおける cuOpt 性能を検証します。\n最先端のイノベーションを大規模な LP に活用\nLP は、一連の線形制約の対象となる線形目的関数を最適化する手法です。\n例えば、こんなシナリオを考えてみてください。農家は、土地、種、肥料に制約がある中で、利益を最大限に高めるために、どの野菜をどれくらい栽培するかを決めなければなりません。目標は、あらゆる制約を満たしながら、できるだけ迅速に最適な収益を決定することです。\nNVIDIA が開発した LLM エージェント\nの例は、LP ソルバーを使用して問題をモデル化し、解決するのに役立ちます。LP は最適化に不可欠なツールであり、リソースの配分、生産計画、サプライチェーン、\n混合整数計画問題\n(MIP: Mixed-integer Programming) ソルバーのバックボーンとして応用されています。数百万もの変数や制約がある数学的問題を数秒で解くことは、不可能ではないにせよ、難しい場合もあります。\nGPU で効率的に LP 問題を解決するには、以下の 3 つの要件があります。\n効率的で大規模な並列アルゴリズム\nNVIDIA GPU ライブラリと CUDA 機能\n最新鋭の NVIDIA GPU\n効率的で大規模な並列アルゴリズム\n1947 年に Dantz 氏によって導入された\nシンプレックス法\nは、現在でもほとんどの LP と MIP ソルバーの中核をなしています。これは、実現可能な領域の端を追って最適値をを求めるものです。\n図 1. シンプレックス法 (出典:\nVisually Explained – What is Linear Programming (LP)?\n)\n次の大きな進歩は、1967 年に I. I. Dikin 氏が発見した\n内点法 (IPM: Interior Point Method)\nでした。多面体の内部を最適値の方向に移動する IPM は、現在では CPU 上で大規模な LP を解く最先端技術だと考えられています。しかしながら、いずれの手法も大規模な並列化には限界があります。\n図 2. 内点法 (出典:\nVisually Explained – What is Linear Programming (LP)?\n)\n2021 年に、大規模 LP を解く新しい画期的な技術として、Google Research チームによって発表されましたのが、\nPDLP\nです。PDLP は、問題の導関数を使用して、目的を繰り返し最適化し、制約違反を最小限に抑える一次法 (FOM: First-order Method) です。\n図3. 勾配降下\nPDLP は、プレソルバー、対角線の前提条件、適応的なリスタート、動的な主双対ステップ サイズ選択など、収束を改善するツールを導入することで、\n主双対ハイブリッド勾配 (PDHG: Primal-dual Hybrid Gradient)\nアルゴリズムを強化します。プレソルバーと前提条件により、入力問題がより簡素化され、数値安定性が向上します。一方、リスタートと動的��テップ サイズ計算により、ソルバーは最適化中に適応することができます。\nFOM が従来の手法よりも優れている点として、大規模な並列化が容易であり、GPU の実装に適しています。\nPDLP は、Map 演算と疎行列ベクトル積 (SpMV: Sparse Matrix-Vector Multiplications) の 2 つの高度に並列化可能な計算パターンを採用しています。このアプローチにより、PDLP は数百万もの変数と制約を効率的に並列処理することができ、GPU に対して非常に効果的になります。\nMap は、PDLP で広く使用されており、数百万の要素に及ぶすべての変数と制約に対して加算や減算などを行います。これは、GPU 上では極めて並列処理が可能でかつ効率的です。\nSpMV は、疎行列 (多くのゼロを含む) とベクトルの乗算に相当します。この行列のサイズは数百億に達しますが、有用な値ははるかに少なくなります。例えば、野菜の植え付け問題では、「3.5 kg 以上のジャガイモを植えることができない」といった制約には、数百万の変数の中で有用な値が 1 つしか含まれないことになります。\nSpMV アルゴリズムは、GPU 向けに広範囲に最適化されており、CPU 実装よりも桁違いに高速です。\nNVIDIA GPU ライブラリと CUDA 機能\n最高のパフォーマンスを得るために、NVIDIA の GPU PDLP 実装では、最先端の CUDA 機能と以下の NVIDIA ライブラリを使用しています。\ncuSparse\nThrust\nRMM\ncuSparse\nは、疎線形代数の NVIDIA GPU 対応ライブラリです。これは、GPU では難しいとされる SpMV を効率的に実行します。cuSparse は、NVIDIA の巨大な並列アーキテクチャをフル活用するように設計された独自のアルゴリズムを採用しています。\nThrust は、\nNVIDIA CUDA コア コンピューティング ライブラリ\n(CCCL) の一部であり、高いレベルの C++ 並列アルゴリズムを提供します。GPU の実行にパターンとイテレーターを使用して、複雑なアルゴリズムの表現を簡素化します。私は、Map 演算とキーで値をソートするリスタートのプロセスに Thrust を使用しました。これは、GPU に負荷がかかる作業ですが、Thrust で効率的に最適化できます。\nRMM\nは、高速かつ柔軟な NVIDIA メモリ管理システムで、メモリ プールを使用することで、GPU メモリの安全で効率的な処理を実現します。\n最後に、高度な CUDA の機能を利用しました。GPU 上で PDLP を並列化する際の最も重要な課題の 1 つは、本来反復的であり、並列実行には適していないリスタート手順です。これに対処するために、私は\nCUDA Cooperative Groups\nを使用しました。これは、さまざまなレベルで GPU アルゴリズムを定義でき、最も大きなのものはすべてのワーカーを網羅するグリッドになります。協調的なカーネル起動を実装し、グリッド同期を利用することで、GPU 上で反復的なリスタート手順を効率的かつエレガントに表現できます。\n最先端の NVIDIA GPU\nGPU は、数千ものスレッドを使用して多くの問題を同時に解決することで、高速計算を実現します。しかし、処理する前に、GPU はまずメイン メモリからワーカー スレッドにデータを転送する必要があります。\nメモリ帯域幅\nとは、1 秒間に転送できるデータ量のことです。CPU では通常、数百 GB\/秒を処理できますが、最新の GPU である\nNVIDIA HGX B100\nの帯域幅は 8 TB\/秒で、2 桁も大きい値です。\nこの PDLP 実装のパフォーマンスは、Map や SpMV のようなメモリ負荷の高い計算パターンに大きく依存しているため、メモリ帯域幅の増加に応じて、直線的に拡大します。将来的に NVIDIA GPU の帯域幅が増加すれば、他の CPU ベースの LP ソルバーとは異なり、PDLP は自動的に高速化されます。\ncuOpt は、Mittelmann のベンチマークで最先端の CPU LP ソルバーを上回る性能を発揮\nLP ソルバーの速度を評価する業界標準が、\nMittelmann のベンチマーク\nです。その目的は、制約を満たしながら LP 関数の最適値を可能な限り最短時間で決定することです。ベンチマークの問題は、さまざまなシナリオを示しており、数十万から数千万の値を含んでいます。\n比較のために、私は最新の CPU LP ソルバーを実行し、この GPU LP ソルバーと比較しました。同じ閾値である 10\n-4\nを用いて、クロスオーバーを無効にしました。詳細については、この投稿の後半にある\nPDLP 改良の可能性\nのセクションを参照してください���\nどちらのソルバーも\nfloat64\nの精度で動作しました。\nCPU LP ソルバーの場合、推奨される CPU 設定である、16 コアと 256 GB の DDR4 メモリを備えた AMD EPYC 7313P サーバーを使用しました。\ncuOpt LP ソルバーの場合、高帯域幅のメリットを活用するため、NVIDIA H100 SXM Tensor コア GPU を使用し、プレソルバーなしで実行しました。\n両方のソルバーのスケーリングと CPU LP ソルバーのプレソルバーなど、I\/O なしの完全な解決時間を考慮しました。正しい目標値を持つ両方のソルバーの場合、収束したインスタンスのみを図 4 で示しています。cuOpt は、60% のインスタンスで高速化し、20% のインスタンスで 10 倍以上高速化しました。最大の高速化は、大規模な多品種流問題の最適化のうちの 1 つのインスタンスで 5,000 倍の高速化が達成されました。\n図 4. Mittelman のベンチマークで CPU LP と比較した cuOpt の高速化\nまた同じ設定と条件を使用して、最新の CPU PDLP の実装と cuOpt を比較しました。cuOpt は常に高速化し、10 倍~ 3000 倍も高速化します。\n図 5. Mittelman のベンチマークで CPU PDLP 実装と比較した cuOpt の高速化\n多品種流問題 (MCF: Multi-commodity Flow Problem) では、ネットワークの容量制約を超えないように、さまざまな出発点からそれぞれの目的地までネットワークを介して複数のさまざまな物をルーティングする最も効率的な方法を見つけることができます。MCF 問題を解決する 1 つの方法は、LP に変換することです。一連の大規模な MCF インスタンスでは、PDLP は一貫して 10 倍から 300 倍の間で高速になります。\n図 6. 一連の MCF インスタンスで CPU LP ソルバーと比較した cuOpt の高速化\nPDLP 改良の可能性\nNVIDIA cuOpt LP ソルバーは、驚異的なパフォーマンスを発揮しますが、将来的に強化される余地もあります。\nより高い精度への対応\n高帯域幅の必要性\n一部の問題に対する収束問題\n小規模な LP に対する限定的な効果\nより高い精度への対応\nLP を解決したかどうかを判断するには、以下の 2 点を測定します。\n最適性のギャップ\n: 目的関数の最適値からの距離を測定します。\n実現可能性\n: 制約をどのくらい満たしているかを測定します。\nLP は、両方の値がゼロになった時、解決したとみなされます。厳密にゼロの値に到達することは困難であり、不要なことも多いため、LP ソルバーは精度を維持しながら収束をより高速化する閾値を使用します。両方の値が、この閾値以下であることが要求されるため、問題の値の大きさに対して相対的なものになります。\nほとんどの LP ソルバーは、特に解決するのが非常に困難な大きな問題に対して、閾値を使用します。これまでの業界標準では、10\n-8\nを使用していました。PDLP は 10\n-8\nを使用して問題を解決することもできますが、通常はかなり時間がかかります。高い精度が求められる場合、これは問題になります。実際には、多くの場合 10\n-4\nで十分な精度であると考える人も多く、場合によってはそれよりも低い値でも十分であると考える人もいます。これは、PDLP には大きな利点となりますが、他の LP 解決アルゴリズムの大きな差別化要因にはなりません。\n高帯域幅の必要性\nPDLP のパフォーマンスはメモリ帯域幅に比例して拡張し、新しい GPU アーキテクチャではより効率的になります。前述したパフォーマンス分析のセクションで示した結果を再現するには、最近のサーバー グレードの GPU が必要です。\n一部の問題に対する収束問題\nPDLP は、ほとんどの LP を迅速に解決できますが、収束するまでにかなりのステップ数が必要になることがあり、その結果、実行時間が長くなることがあります。Mittelman のベンチマークでは、cuOpt LP ソルバーは、49 の公開インスタンスのうち 8 つで、収束率が遅いため、1 時間後にタイムアウトしました。\n小規模な LP に対する限定的な効果\n小規模な LP が、GPU の高帯域幅から利益を得ることは少なく、CPU ソルバーと比較して PDLP を拡張できません。cuOpt LP ソルバーは、このようなシナリオに対応するバッチモードを用意しており、数百もの小規模な LP を並行して提供し、解決できます。\nまとめ\ncuOpt LP ソルバーは、CUDA プログラミング、NVIDIA GPU ライブラリ、および最新鋭の NVIDIA GPU を使用して、LP を解決し���す。これは、CPU よりも桁違いに高速で、10 億を超える係数にまで拡大される可能性があります。その結果、大規模な問題に取り組む上で特に有益であり、その利点はさらに顕著になります。\nGTC セッション:\nAdvances in Optimization AI (最適化 AI の進歩)\nNGC コンテナー:\ncuOpt\nSDK:\ncuOpt\nSDK:\ncuSOLVERMp\nSDK:\ncuSOLVER\n従来のシンプレックス法や IPM を用いたほうが上手くいくユース ケースもありますが、将来的には、GPU と CPU の技術を組み合わせたソルバーが主流になるでしょう。\n登録すると、\ncuOpt LP を試せるように\nなった際に、通知を受け取ることができます。\nNVIDIA API カタログ\nで、\nNVIDIA が提供する\n最新の AI モデル向けの NIM マイクロサービスを使用して、NVIDIA の\ncuOpt 車両経路問題 (VPR: Vehicle Routing Problem\n) を今すぐ無料でお試しください。\n関連情報"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/managing-ai-inference-pipelines-on-kubernetes-with-nvidia-nim-operator\/","en_title":"Managing AI Inference Pipelines on Kubernetes with NVIDIA NIM Operator","en_content":"Developers have shown a lot of excitement for\nNVIDIA NIM microservices\n, a set of easy-to-use cloud-native microservices that shortens the time-to-market and simplifies the deployment of generative AI models anywhere, across cloud, data centers, cloud, and GPU-accelerated workstations.\nTo meet the demands of diverse use cases, NVIDIA is bringing to market a variety of different AI models packaged as NVIDIA NIM microservices, which enable key functionality in a\ngenerative AI inference workflow\n.\nA typical generative AI application integrates multiple different NIM microservices. For instance,\nmulti-turn conversational AI in a RAG pipeline\nuses the LLM, embedding, and re-ranking NIM microservices. The deployment and lifecycle management of these microservices and their dependencies for production generative AI pipelines can lead to additional toil for the MLOps and LLMOps engineers and Kubernetes cluster admins.\nThis is why NVIDIA is announcing the\nNVIDIA NIM Operator\n, a Kubernetes operator designed to facilitate the deployment, scaling, monitoring, and management of NVIDIA NIM microservices on Kubernetes clusters. With NIM Operator, you can deploy, auto-scale, and manage the lifecycle of NVIDIA NIM microservices with just a few clicks or commands.\nCluster admins and MLOps and LLMOps engineers don’t have to put effort into the manual deployment, scaling, and lifecycle management of AI inference pipelines. NIM Operator handles all of this and more.\nCore capabilities and benefits\nDevelopers are looking to reduce the effort of deploying AI inference pipelines at scale in local deployments. NIM Operator facilitates this with simplified, lightweight deployment and manages the lifecycle of AI NIM inference pipelines on Kubernetes. NIM Operator also supports pre-caching models to enable faster initial inference and autoscaling.\nFigure 1. NIM Operator architecture\nFigure 2. NIM Operator Helm deployment\nIntelligent model pre-caching\nNIM Operator offers\npre-caching of models\nthat reduces initial inference latency and enables faster autoscaling. It also enables model deployments in air-gapped environments.\nUse NIM intelligent model pre-caching by specifying NIM profiles and tags, or let NIM Operator auto-detect the best model based on the GPUs available on the Kubernetes cluster. You can pre-cache models on any available node based on your requirements, either on CPU-only or on GPU-accelerated nodes.\nWhen this option is selected, NIM Operator creates a persistent volume claim (PVC) in Kubernetes and then downloads and caches the NIM models in the cluster. Then, NIM Operator deploys and manages the lifecycle of this PVC using the\nNIMCache\ncustom resource.\nFigure 3. NIM microservice cache deployment\nAutomated AI NIM pipeline deployments\nNVIDIA is introducing two Kubernetes custom resource definitions (CRDs) to deploy NVIDIA NIM microservices:\nNIMService\nand\nNIMPipeline\n.\nNIMService\n, when deployed, manages each NIM microservice as a standalone microservice.\nNIMPipeline\nenables the deployment and management of several NIM microservices collectively.\nFigure 4 shows a RAG pipeline managed as a microservice pipeline. You can manage multiple pipelines as a collection instead of individual services.\nFigure 4. NIM microservice pipeline deployment\nAutoscaling\nNIM Operator supports\nauto-scaling the NIMService deployment\nand its\nReplicaSet\nusing Kubernetes Horizontal Pod Autoscaler (HPA).\nThe\nNIMService\nand\nNIMPipeline\nCRDs support all the familiar HPA metrics and scaling behaviors, such as the following:\nSpecify minimum and maximum replica counts\nScale using the following metrics:\nPer-pod resource metrics, such as CPU\nPer-pod custom metrics, such as GPU memory usage\nObject metrics, such as NIM max requests or\nKVCache\nExternal metrics\nYou can also specify any HPA scale-up and scale-down behavior, for example, a stabilization window to prevent flapping and scaling policies to control the rate of change of replicas while scaling.\nFor more information, see\nGPU Metrics\n.\nFigure 5. NIM Auto-scaling\nDay 2 operations\nNIMService\nand\nNIMPipeline\nsupport easy rolling upgrades of NIM with a customizable rolling strategy. Change the version number of the NIM in the\nNIMService\nor\nNIMPipeline\nCRD and NIM Operator updates the NIM deployments in the cluster.\nAny changes in\nNIMService\npods are reflected in the\nNIMService\nand\nNIMPipeline\nstatus. You can also add Kubernetes ingress for\nNIMService\n.\nSupport matrix\nAt launch, NIM Operator supports the reasoning LLM and the retrieval—embedding NIM microservice.\nWe are continuously expanding the list of supported NVIDIA NIM microservices. For more information about the full list of supported NIM microservices, see\nPlatform Support\n.\nConclusion\nBy automating the deployment, scaling, and lifecycle management of NVIDIA NIM microservices, NIM Operator makes it easier for enterprise teams to adopt NIM microservices and accelerate AI adoption.\nThis effort aligns with our commitment to make NIM microservices easy to adopt, production-ready, and secure. NIM Operator will be part of future releases of NVIDIA AI Enterprise to provide enterprise support, API stability, and proactive security patching.\nGet started with\nNIM Operator through NGC today\n, or get it from the\nGitHub repo\n. For technical questions on installation, usage, or issues, please file an issue on the repo.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/managing-ai-inference-pipelines-on-kubernetes-with-nvidia-nim-operator\/","jp_title":"NVIDIA NIM Operator で Kubernetes の AI 推論パイプラインを管理","jp_content":"Reading Time:\n2\nminutes\n開発者は、これは、クラウド、データ センター、クラウド、GPU により高速化されたワークステーションなど、あらゆる場所で市場投入までの時間を短縮し、生成 AI モデルのデプロイを簡素化することができる、使いやすいクラウドネイティブのマイクロサービスである\nNVIDIA NIM マイクロサービス\nに大いに期待しています。\n多様なユース ケースの要求に応えるため、NVIDIA は、NVIDIA NIM マイクロサービスとしてパッケージ化されたさまざまな AI モデルを市場に投入しており、\n生成 AI 推論ワークフロー\nの主要な機能を実現しています。\n通常の生成 AI アプリケーションでは、複数の異なる NIM マイクロサービスを統合しています。例えば、\nRAG パイプラインのマルチターン対話型 AI\nでは、LLM、埋め込み、リランキングなどの複数の NIM マイクロサービスを使用しています。これらのマイクロサービスのデプロイやライフサイクル管理、本番環境の生成 AI パイプラインへの依存関係により、MLOps および LLMOps のエンジニア、Kubernetes クラスターの管理者の労力がさらに増える場合があります。\nこのため、NVIDIA は、Kubernetes クラスターで NVIDIA NIM マイクロサービスのデプロイ、スケーリング、監視、管理を容易にするよう設計された Kubernetes オペレーターである\nNVIDIA NIM Operator\nを発表しました。NIM Operator を使用すれば、わずか数回のクリックまたはコマンドで、NVIDIA NIM マイクロサービスのデプロイ、オートスケーリング、ライフサイクルを管理することができます。\nクラスター管理者や MLOps および LLLMOps のエンジニアが、AI 推論パイプラインの手作業によるデプロイ、スケーリング、ライフサイクル管理に労力を費やす必要はありません。NIM Operator がこれらすべてに対処します。\n主な機能とメリット\n開発者は、AI 推論パイプラインをローカルで大規模にデプロイする労力を軽減したいと考えています。NIM Operator は、簡素化された軽量なデプロイでこれを促進して、Kubernetes で AI NIM 推論パイプラインのライフサイクルを管理します。NIM Operator は、モデルの事前キャッシュもサポートしており、初期推論とオートスケーリングをより高速化することができます。\n図 1. NIM Operator のアーキテクチャ\n図 2. NIM Operator Helm のデプロイ\nモデルのインテリジェント事前キャッシュ\nNIM Operator は、\nモデルの事前キャッシュ\nを行い、初期推論の遅延を低減して、オートスケーリングをより高速化することができます。また、インターネット接続のない環境でもモデルのデプロイが可能です。\nNIM プロファイルとタグを指定して、NIM モデルのインテリジェント事前キャッシュを使用するか、Kubernetes クラスターで利用可能な GPU に基づいて、NIM Operator に最適なモデルを自動検出させます。CPU のみが搭載されたノードでも、GPU により高速化されたノードでも、要件に応じて利用可能なノードにモデルを事前キャッシュすることができます。\nこのオプションを選択すると、NIM Operator は、Kubernetes にPersistent Volume Claim (PVC) を作成し、クラスターに NIM モデルをダウンロードしてキャッシュします。次に、NIM Operator が NIMCache カスタム リソースを使用して、この PVC のライフサイクルをデプロイして管理します。\n図 3. NIM マイクロサービス キャッシュのデプロイ\n自動 AI NIM パイプライン デプロイ\nNVIDIA は、2 つの Kubernetes カスタム リソース定義 (CRD) を導入して、NVIDIA NIM マイクロサービスである\nNIMService\nと\nNIMPipeline\nをデプロイします。\nNIMService\nがデプロイされると、各 NIM マイクロサービスをスタンドアロンのマイクロサービスとして管理します。\nNIMPipeline\nは、複数の NIM マイクロサービスをまとめてデプロイし、管理することができます。\n図 4 は、マイクロサービス パイプラインとして管理される RAG パイプラインを示しています。複数のパイプラインを個別のサービスではなく、一括して管理できます。\n図 4. NIM マイクロサービス パイプラインのデプロイ\nオートスケーリング\nNIM Operator は、Kubernetes Horizontal Pod Autoscaler (HPA) を使用して、\nNIMService のデプロイ\nとその ReplicaSet のオートスケーリングに対応しています。\nNIMService\nと\nNIMPipeline\nの CRD は、以下のような HPA でおなじみのメトリクスとスケーリング動作をすべてサポートしています。\nレプリカ数の最小値と最大値を指定する\n以下のメトリクスを使用してスケーリングする\nCPU など、ポッドごとのリソース メトリクス\nGPU メモリの使用量など、ポッドごとのカスタム メトリクス\nNIM 最大リクエストや KVCache などのオブジェクト メトリクス\n外部メトリクス\nまた、フラップを防止する安定化ウィンドウや、スケーリング中にレプリカ数の変化を制御するスケーリング ポリシーなど、HPA のスケールアップ動作とスケールダウン動作を指定することもできます。\n詳細については、\nGPU メトリクス\nをご覧ください。\n図 5. NIM オートスケーリング\n2 日目のオペレーション\nNIMService\nと\nNIMPipeline\nは、カスタマイズ可能なローリング戦略で NIM の簡単なローリング アップグレードをサポートしています。\nNIMService\nまたは\nNIMPipeline\nCRD で NIM のバージョン番号を変更すると、NIM Operator は、クラスターの NIM デプロイを更新します。\nNIMService\nポッドの変更はすべて\nNIMService\nと\nNIMPipeline\nのステータスに反映されます。\nNIMService\n向けに Kubernetes Ingress を追加することもできます。\nサポートされるモデルとプラットフォーム\nリリース時点で、NIM Operator は、LLM やRetrieval(埋め込み) NIM マイクロサービスをサポートしています。\nNVIDIA は、サポート対象の NVIDIA NIM マイクロサービスのリストを継続的に拡大しています。サポート対象の NIM マイクロサービスの全リストの詳細については、\nプラットフォーム サポート\nをご覧ください\n。\nまとめ\nNVIDIA NIM マイクロサービスのデプロイ、スケーリング、ライフサイクル管理を自動化することで、NIM Operator は、エンタープライズ チームが NIM マイクロサービスを簡単に導入し、AI の導入を高速化できるようにします。\nこの取り組みは、NIM マイクロサービスを簡単に導入でき、本番環境に対応し、安全性を確保するという NVIDIA のコミットメントとも一致しています。NIM Operator は、NVIDIA AI Enterprise が今後リリースする機能の一部で、エンタープライズ サポート、API の安定性、プロアクティブなセキュリティ パッチを提供します。\n今すぐ NGC で NIM Operator\nを使い始めるか、\nGitHub リポジトリ\nから入手してください。インストール、使用方法、問題に関する技術的な質問については、リポジトリに Issue を提出してください。\n関連情報\nGTC セッション:\nエンタープライズの加速: 次世代 AI デプロイのためのツールやテクニック\nGTC セッション:\nLLM 推論サイジング: エンドツーエンド推論システムのベンチマーク\nNGC コンテナー:\nNVIDIA NIM Operator\nNGC コンテナー:\nNVIDIA GPU Operator\nNGC コンテナー:\nNV-CLIP\nウェビナー:\n本���環境対応の生成 AI で世界最高クラスのテキスト検索精度を実現"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/deploying-accelerated-llama-3-2-from-the-edge-to-the-cloud\/","en_title":"Deploying Accelerated Llama 3.2 from the Edge to the Cloud","en_content":"Expanding the open-source Meta Llama collection of models, the Llama 3.2 collection includes vision language models (VLMs), small language models (SLMs), and an updated Llama Guard model with support for vision. When paired with the NVIDIA accelerated computing platform, Llama 3.2 offers developers, researchers, and enterprises valuable new capabilities and optimizations to realize their generative AI use cases.\nTrained on\nNVIDIA H100 Tensor Core GPUs\n, the SLMs in 1B and 3B sizes are ideal for deploying Llama-based AI assistants across edge devices. The VLMs in 11B and 90B sizes support text and image inputs and output text. With multimodal support, the VLMs help developers build powerful applications requiring visual grounding, reasoning, and understanding. For example, they can build AI agents for image captioning, image-text retrieval, visual Q&A, and document Q&A, among others. The Llama Guard models now also support image input guardrails in addition to text input.\nLlama 3.2 model architecture is an auto-regressive language model that uses an optimized transformer architecture. The instruction tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety. All models support a long context length of 128K tokens and are optimized for inference with support for grouped query attention (GQA).\nNVIDIA is optimizing the Llama 3.2 collection of models to deliver high throughput and low latency across millions of GPUs worldwide—from data centers to local workstations with\nNVIDIA RTX\n, and at the edge with\nNVIDIA Jetson\n. This post describes the hardware and software optimizations, customizations, and ease-of-deployment capabilities.\nAccelerating Llama 3.2 performance with NVIDIA TensorRT\nNVIDIA is accelerating the Llama 3.2 model collection to reduce cost and latency while delivering unparalleled throughput and providing an optimal end-user experience.\nNVIDIA TensorRT\nincludes\nTensorRT\nand\nTensorRT-LLM\nlibraries for high-performance deep learning inference.\nThe Llama 3.2 1B and Llama 3.2 3B models are being accelerated for long-context support in TensorRT-LLM using the\nscaled rotary position embedding (RoPE)\ntechnique and several other\noptimizations\n, including KV caching and in-flight batching.\nThe Llama 3.2 11B and Llama 3.2 90B models are multimodal and include a vision encoder with a text decoder. The vision encoder is being accelerated by exporting the model into an ONNX graph and building the TensorRT engine.\nONNX\nexport creates a standard model definition with built-in operators and standard data types, focused on inferencing. TensorRT uses the ONNX graph to optimize the model for target GPUs by building the\nTensorRT engine\n. These engines offer a variety of hardware-level optimizations to maximize NVIDIA GPU utilization through layer and tensor fusion in conjunction with kernel auto-tuning.\nThe visual information from the vision encoder is fused into the Llama text decoder with a cross-attention mechanism that is supported in TensorRT-LLM. This enables the VLMs to efficiently generate text by taking into account visual reasoning and understanding in context with text input.\nEasily deploy generative AI solutions using NVIDIA NIM\nThe TensorRT optimizations are available through production-ready deployments using\nNVIDIA NIM\nmicroservices. NIM microservices accelerate the deployment of generative AI models across NVIDIA-accelerated infrastructure anywhere, including cloud, data center, and workstations.\nLlama 3.2 90B Vision Instruct\n,\nLlama 3.2 11B Vision Instruct\n,\nLlama 3.2 3B Instruct\n, and\nLlama 3.2 1B Instruct\nare supported through NIM microservices for production deployments. NIM provides simplified management and orchestration of generative AI workloads, standard application programming interface (APIs), and enterprise support with production-ready containers. Offering strong and growing ecosystem support with over 175 partners integrating their solutions with NVIDIA NIM microservices, developers, researchers and enterprises around the world can maximize their return on investment for generative AI applications.\nCustomize and evaluate Llama 3.2 models with NVIDIA AI Foundry and NVIDIA NeMo\nNVIDIA AI Foundry\nprovides an end-to-end platform for Llama 3.2 model customizations with access to advanced AI tools, computing resources, and AI expertise. Fine-tuned on proprietary data, the custom models enable enterprises to achieve better performance and accuracy in domain-specific tasks, gaining a competitive edge.\nWith\nNVIDIA NeMo\n, developers can curate their training data, leverage advanced tuning techniques including LoRA, SFT, DPO, and RLHF to customize the Llama 3.2 models, evaluate for accuracy, and add guardrails to ensure appropriate responses from the models. AI Foundry provides dedicated capacity on\nNVIDIA DGX Cloud\n, and is supported by NVIDIA AI experts. The output is a custom Llama 3.2 model packaged as an NVIDIA NIM inference microservice, which can be deployed anywhere.\nScale local inference with NVIDIA RTX and NVIDIA Jetson\nToday, Llama 3.2 models are optimized on the 100M+ NVIDIA RTX PCs and workstations worldwide. For Windows deployments, NVIDIA has optimized this suite of models to work efficiently using the ONNX-GenAI runtime, with a DirectML backend. Get started with the\nLlama 3.2 3B model on NVIDIA RTX\n.\nThe new VLM and SLM models unlock new capabilities on NVIDIA RTX systems. To demonstrate, we created an example of a multimodal\nretrieval-augmented generation (RAG)\npipeline that combines text and visual data processing (for images, plots, and charts, for example) for enhanced information retrieval and generation.\nLearn how to run this pipeline on NVIDIA RTX Linux systems using the Llama 3.2 SLM and VLM\n. Note that you’ll need a Linux workstation with an NVIDIA RTX professional GPU with 30+ GB of memory.\nSLMs are tailored for local deployment on edge devices using techniques like distillation, pruning, and quantization to reduce memory, latency, and computational requirements while retaining accuracy for application-focused domains. To download and deploy the Llama 3.2 1B and 3B SLMs onboard your Jetson with optimized GPU inference and INT4\/FP8 quantization, see the\nSLM Tutorial on NVIDIA Jetson AI Lab\n.\nMultimodal models are increasingly useful in edge applications for their unique vision capabilities in video analytics and robotics. The\nLlama 3.2 11B VLM is supported on embedded Jetson AGX Orin 64 GB\n.\nAdvancing community AI models\nAn active open-source contributor, NVIDIA is committed to optimizing community software that helps users address their toughest challenges. Open-source AI models also promote transparency and enable users to broadly share work on AI safety and resilience.\nThe\nHugging Face inference-as-a-service\ncapabilities enable developers to rapidly deploy leading\nlarge language models (LLMs)\nsuch as the Llama 3 collection with optimization from NVIDIA NIM microservices running on\nNVIDIA DGX Cloud\n.\nGet free access to NIM for research, development, and testing through the\nNVIDIA Developer Program\n.\nExplore the NVIDIA AI inference platform further, including how\nNVIDIA NIM\n,\nNVIDIA TensorRT-LLM\n,\nNVIDIA TensorRT,\nand\nNVIDIA Triton\nuse state-of-the-art techniques such as\nLoRA\nto accelerate the latest LLMs.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/deploying-accelerated-llama-3-2-from-the-edge-to-the-cloud\/","jp_title":"高速化された Llama 3.2 をエッジからクラウドへデプロイする","jp_content":"Reading Time:\n2\nminutes\nオープンソースの Meta Llama モデルのコレクションを拡張した Llama 3.2 コレクションには、視覚言語モデル (VLM)、小規模言語モデル (SLM)、ビジョンのサポートが追加された Llama Guard モデルが含まれています。NVIDIA のアクセラレーテッド コンピューティング プラットフォームと組み合わせることで、Llama 3.2 は開発者、研究者、企業に、生成 AI のユース ケースを実現するための有益な新機能と最適化を提供します。\nNVIDIA H100 Tensor コア GPU\nでトレーニングされた 1B および 3B サイズの SLM は、エッジ デバイスに Llama ベースの AI アシスタントを展開するのに最適です。11B および 90B サイズの VLM は、テキストと画像の入力とテキストの出力をサポートします。マルチモーダルをサポートする VLM は、グラウンディング (Visual grounding)、推論 (Reasoning)、理解を必要とする強力なアプリケーションを開発するのに役立ちます。例えば、画像キャプショニング、画像テキスト検索、ビジュアル Q&A、文書 Q&A などを担当する AI エージェントを構築することができます。Llama Guard モデルは、テキスト入力に加えて、画像入力のガードレールもサポートするようになりました。\nLlama 3.2 モデル アーキテクチャは、最適化された Transformer アーキテクチャを使用する自己回帰言語モデルです。指示チューニング版では、教師ありファインチューニング (SFT) と、人間のフィードバックによる強化学習 (RLHF) を使用して、人間の好みに合わせた有用性と安全性を実現しています。すべてのモデルは 128K トークンの長いコンテキスト長をサポートし、グループ化されたクエリ アテンション (GQA) のサポートと共に推論に最適化されています。\nNVIDIA は、Llama 3.2 のモデル コレクションを最適化しており、データ センターから\nNVIDIA RTX\n搭載のローカル ワークステーション、そして\nNVIDIA Jetson\n搭載のエッジに至るまで、世界中の数百万の GPU で高スループットと低遅延を実現しています。この記事では、ハードウェアとソフトウェアの最適化、カスタマイズ、デプロイを容易にする機能について説明します。\nNVIDIA TensorRT による Llama 3.2 のパフォーマンスの高速化\nNVIDIA は、Llama 3.2 モデル コレクションを高速化し、コストとレイテンシを低減しながら、比類のないスループットと最適なエンド ユーザー体験を提供しています。\nNVIDIA TensorRT\nには、高性能なディープラーニング推論用の\nTensorRT\nおよび\nTensorRT-LLM\nライブラリが含まれています。\nLlama 3.2 1B および Llama 3.2 3B モデルは、TensorRT-LLM の長コンテキスト サポートのために、\nScaled Rotary Position Embedding (RoPE)\n技術と KV キャッシュおよびインフライト バッチングなど、その他、\n複数の最適化手法\nを使用して高速化されています。\nLlama 3.2 11B と Llama 3.2 90B はマルチモーダルで、テキスト デコーダーを備えたビジョン エンコーダーが搭載されています。ビジョン エンコーダーは、モデルを ONNX グラフにエクスポートし、TensorRT エンジンを構築することで加速されています。\nONNX\nのエクスポートでは、推論に重点を置いた組み込みの演算子と標準データ型を用いた標準モデル定義が作成されます。TensorRT は ONNX グラフを使用し、\nTensorRT エンジン\nを構築することで、ターゲット GPU にモデルを最適化します。これらのエンジンは、カーネル自動チューニングとレイヤー、テンソルの融合を通じて、NVIDIA GPU の利用を最大限に高めるために、ハードウェア レベルで多様な最適化を提供します。\nビジョン エンコーダーから取得した視覚情報は、TensorRT-LLM でサポートされているクロス アテンションのメカニズムを使用して Llama テキスト デコーダーに融合されます。これにより VLM は、テキスト入力のコンテキストにおける理解と視覚的な推論 (Reasoning) を考慮に入れて、効率的にテキストを生成できるようになります。\nNVIDIA NIM を使用して生成 AI ソリューションを容易にデプロイ\nTensorRT の最適化は、\nNVIDIA NIM\nマイクロサービスを使用した本番環境へのデプロイを通じて利用できます。NIM マイクロサービスは、クラウド、データ センター、ワークステーションなど、NVIDIA がアクセラレートするインフラ全体で生成 AI モデルのデプロイを加速します。\nLlama 3.2 90B Vision Instruct\n、\nLlama 3.2 11B Vision Instruct\n、\nLlama 3.2 3B Instruct\nおよび\nLlama 3.2 1B Instruct\nは、NIM マイクロサービスを通じた本番環境へのデプロイに対応しています。NIM は、生成 AI ワークロードの簡素化された管理とオーケストレーション、標準的なアプリケーション プログラミング インターフェイス (API) および本番環境に対応したコンテナーによるエンタープライズ サポートを提供します。175 社を超えるパートナーが自社のソリューションを NVIDIA NIM マイクロサービスと統合し、強力で拡大を続けるエコシステム サポートを提供することで、世界中の開発者、研究者、企業は、生成 AI アプリケーションに対する投資収益率を最大化できます。\nNVIDIA AI Foundry と NVIDIA NeMo による Llama 3.2 モデルのカスタマイズと評価\nNVIDIA AI Foundry\nは、高度な AI ツール、コンピューティング リソース、AI の専門知識にアクセスできる、Llama 3.2 モデルのカスタマイズに適したエンドツーエンドのプラットフォームを提供します。独自のデータに基づいてファインチューニングしたカスタム モデルにより、企業は特定ドメインにおける業務でより優れたパフォーマンスと精度を達成し、競争力を高めることができます。\nNVIDIA NeMo\nを使用することで、開発者はトレーニング データをキュレーションして LoRA、SFT、DPO、RLHF などの高度なチューニング技術を活用して、Llama 3.2 モデルをカスタマイズし、精度を評価し、ガードレールを追加して、モデルから適切な応答が得られるようになります。AI Foundry は、\nNVIDIA DGX Cloud\n上で専用のリソースを提供し、そして NVIDIA AI の専門家によってサポートされています。出力は、NVIDIA NIM 推論マイクロサービスとしてパッケージ化されたカスタム Llama 3.2 モデルで、どこにでもデプロイすることができます。\nNVIDIA RTX および NVIDIA Jetson によるローカル推論のスケーリング\n現在、Llama 3.2 モデルは、世界中の 1 億台を超える NVIDIA RTX 搭載 PC およびワークステーションで最適化されています。Windows でのデプロイ用に NVIDIA はこのモデル スイートを最適化し、DirectML バックエンドで ONNX-GenAI ランタイムを使用して効率的に動作するようにしました。\nNVIDIA RTX で Llama 3.2 3B モデル\nを使用してみましょう。\n新しい VLM と SLM モデルは、NVIDIA RTX システムに新たな可能性をもたらします。実証するために、テキストと視覚データ処理 (例えば画像、グラフ、表など) を組み合わせ、情報検索と生成を強化するマルチモーダル\n検索拡張生成 (RAG)\nパイプラインの例を作成しました。\nLlama 3.2 SLM と VLM を使用して NVIDIA RTX Linux システム上でこのパイプラインを実行する方法についてご覧ください\n。30 GB 以上のメモリを搭載する NVIDIA RTX プロフェッショナル GPU を搭載した Linux ワークステーションが必要となります。\nSLM は、アプリケーションに特化したドメインの精度を確保しながらメモリ、レイテンシおよび演算要件を削減するために、蒸留、プルーニング、量子化などの技術を使用して、エッジ デバイスへのローカル デプロイに合わせてカスタマイズされています。最適化された GPU の推論と INT4\/FP8 量子化を備えた Jetson に、Llama 3.2 1B および 3B SLM をダウンロードしてデプロイするには、\nNVIDIA Jetson AI Lab の SLM チュートリアル\nを参照してください。\nマルチモーダル モデルは、ビデオ分析やロボティクスにおける独自のビジョン機能により、エッジ アプリケーションで有用性が高まってきています。\nLlama 3.2 11B VLM は、組み込みの Jetson AGX Orin 64 GB でサポートされています\n。\nコミュニティ AI モデルの進化\nオープンソースに積極的に貢献している NVIDIA では、ユーザーが直面する最も困難な課題で支援できるように、コミュニティ ソフトウェアの最適化に取り組んでいます。オープンソースの AI モデルは透明性を促進し、ユーザーは AI の安全性とレジリエンスに関する作業を広く共有することが可能になります。\nHugging Face の推論サービス (Inference-as-a-Service)\n機能により、開発者は\nNVIDIA DGX Cloud\n上で動作する NVIDIA NIM マイクロサービスで最適化された Llama 3 コレクションなどの\n大規模言語モデル (LLM)\nを迅速にデプロイすることができます。\nNVIDIA 開発者プログラム\nを通じて、研究、開発、テスト用の NIM への無料アクセスを利用できます。\nNVIDIA NIM\n、\nNVIDIA TensorRT-LLM\n、\nNVIDIA TensorRT\n、\nNVIDIA Triton\nなどのNVIDIA AI 推論プラットフォームが、\nLoRA\nでチューニングした最新の LLM の高速化など、どのように最先端の技術を使用しているのかについては詳細を是非調べてみてください。\n関連情報\nGTC セッション:\nLLM クラスター アーキテクチャの青写真: 世界最大規模のデプロイに向けたスケーリング (Supermicro による講演)\nNGC コンテナー:\nLlama-3-Swallow-70B-Instruct-v0.1\nNGC コンテナー:\nLlama-3.1-405b-instruct\nSDK:\nLlama3 8B Instruct NIM"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/advancing-the-accuracy-efficiency-frontier-with-llama-3-1-nemotron-51b\/","en_title":"Advancing the Accuracy-Efficiency Frontier with Llama-3.1-Nemotron-51B","en_content":"Today, NVIDIA released a unique language model that delivers an unmatched accuracy-efficiency performance. Llama 3.1-Nemotron-51B, derived from Meta’s Llama-3.1-70B, uses a novel neural architecture search (NAS) approach that results in a highly accurate and efficient model.\nThe model fits on a single NVIDIA H100 GPU at high workloads, making it much more accessible and affordable. The excellent accuracy-efficiency sweet spot exhibited by the new model stems from changes to the model’s architecture that lead to a significantly lower memory footprint, reduced memory bandwidth, and reduced FLOPs while maintaining excellent accuracy. We demonstrate that this approach can be generalized by creating another smaller and faster variant from the reference model.\nIn July 2024, Meta released Llama-3.1-70B, a leading state-of-the-art large language model (LLM). Today we announce\nLlama 3.1-Nemotron-51B-Instruct\n, developed using NAS and knowledge distillation derived from the reference model, Llama-3.1-70B.\nSuperior throughput and workload efficiency\nThe Nemotron model yields 2.2x faster inference compared to the reference model while maintaining nearly the same accuracy. The model opens a new set of opportunities with a reduced memory footprint, which enables running 4x larger workloads on a single GPU during inference.\nAccuracy\nEfficiency\nMT Bench\nMMLU\nText generation\n(128\/1024)\nSummarization\/ RAG (2048\/128)\nLlama-3.1- Nemotron-51B- Instruct\n8.99\n80.2%\n6472\n653\nLlama 3.1-70B- Instruct\n8.93\n81.66%\n2975\n339\nLlama 3.1-70B- Instruct (single GPU)\n—\n—\n1274\n301\nLlama 3-70B\n8.94\n80.17%\n2975\n339\nTable 1. Overview of the Llama-3.1-Nemotron-51B-Instruct accuracy and efficiency.\nNote: Speed is reported in tokens per second per GPU, Measured on machines equipped with 8 X NVIDIA H100 SXM GPUs, with FP8 quantization using\nTRT-LLM\nas the runtime engine. For each model with the optimal number of GPUs through tensor parallelism (unless otherwise stated). The numbers in the brackets show the (input\/output sequence lengths).\nWe discuss the detailed performance metrics later in this post.\nOptimized accuracy per dollar\nFoundation models display incredible quality in solving complex tasks: reasoning, summarization, and more. However, a major challenge in the adoption of ‌top models is their inference cost.\nAs the field of generative AI evolves, the balance between accuracy and efficiency (directly impacting cost) will become the decisive factor in model selection. Moreover, the capability to run a model on a single GPU significantly streamlines its deployment, opening opportunities for new applications to run anywhere, from edge systems to data centers to the cloud, as well as facilitating serving multiple models via Kubernetes and\nNIM blueprints\n.\nConsequently, we engineered Llama 3.1-Nemotron-51B-Instruct to achieve this optimal tradeoff (Figure 1). Throughput is inversely proportional to price, so the best tradeoff is obtained by models on the efficient frontier displayed in the chart. Figure 1 shows that the model pushes beyond the current efficient frontier, making it the model that provides the best accuracy per dollar.\nFigure 1. Accuracy vs. Throughput performance of Llama-3.1-Nemotron-51B compared to frontier models. Throughput was measured through NIM with concurrency 25 (serving throughput).\nThe model quality is defined as the weighted average of MT-Bench and MMLU (10*MT-Bench + MMLU)\/2, plotted compared to model throughput per a single NVIDIA H100 80GB GPU. Gray dots represent state-of-the-art models, while the dashed line represents the ‘efficient frontier’.\nSimplifying inference with NVIDIA NIM\nThe Nemotron model is optimized with TensorRT-LLM engines for higher inference performance and packaged as an NVIDIA NIM microservice to streamline and accelerate the deployment of generative AI models across NVIDIA accelerated infrastructure anywhere, including cloud, data center, and workstations.\nNIM uses inference optimization engines, industry-standard APIs, and prebuilt containers to provide high-throughput AI inference that scales with demand.\nTry out\nLlama-3.1-Nemotron-51B NIM microservice\nthrough the API from\nai.nvidia.com\nwith free NVIDIA credits.\nBuilding the model with NAS\nInference and hardware-aware methods for designing neural architectures have been successfully used in many domains. However, LLMs are still constructed as repeated identical blocks, with little regard for inference cost overheads incurred by this simplification. To tackle these challenges, we developed efficient NAS technology and training methods that can be used to create non-standard transformer models designed for efficient inference on specific GPUs.\nOur technology can select neural architectures that optimize various constraints. The range includes enormous design spaces that include a zoo of non-standard transformer models using alternative attention and FFN blocks of varying efficiency degrees, up to a complete block elimination in the extreme case.\nWe then use our block-distillation (Figure 2) framework to train all these block variants for all layers of a (large) parent LLM in parallel. In a basic version of block-distillation, training data is passed through the reference model  (also known as a teacher).\nFor each block, its input is taken from the teacher and injected into the matching block of the student. The outputs of the teacher and student for the block are compared and the student block is trained so that the student block mimics the functionality of the teacher block. A more advanced scenario where a single student block mimics multiple teacher blocks is depicted on the right side in Figure 2.\nFigure 2. Block distillation where blue reference model blocks are multiple variants for the yellow student models that mimic the block-wise teacher functionality\nNext, we use our Puzzle algorithm to efficiently score each alternative replacement puzzle piece and search our enormous design space for the most accurate models, while adhering to a set of inference constraints, such as memory size and required throughput.\nFinally, by using knowledge distillation (KD) loss for both block scoring and training, we demonstrate the potential to narrow the accuracy gap between our model and the reference model using a much more efficient architecture with a tiny fraction of the reference model training costs. Using our methods on Llama-3.1-70B as the reference model, we built ​​Llama-3.1-Nemotron-51B-Instruct, a 51B model that breaks the efficient frontier of LLMs on a single NVIDIA H100 GPU (Figure 1).\nThe ​​Llama-3.1-Nemotron-51B-Instruct architecture is unique in its irregular block structure with many layers in which the attention and FFN are reduced or pruned, resulting in better utilization of H100 and highlighting the importance of optimizing LLMs for inference. Figure 3 schematically depicts the irregular structure of the resulting architecture and highlights the resulting compute saving, which amounts to the green area in the Figure.\nFigure 3. Runtime of Puzzle chosen blocks (layers) for attention layers (blue) and FFN layers (red) across the 80 layers of the reference model. Green areas correspond to overall runtime savings.\nOur innovative techniques enable us to develop models that redefine the efficient frontier of LLMs. Crucially, we can cost-effectively design multiple models from a single reference model, each optimized for specific hardware and inference scenarios. This capability empowers us to maintain best-in-class performance for LLM inference across our current and future hardware platforms.\nDetailed results\nHere are the model accuracy and performance metrics for our model.\nModel accuracy\nTable 2 lists all the benchmarks that we evaluated, comparing our model and the reference model Llama-3.1-70B. The\nAccuracy preserved\ncolumn is the ratio between our model’s score and that of the teacher.\nBenchmark\nLlama-3.1 70B-instruct\nLlama-3.1-Nemotron-51B- Instruct\nAccuracy preserved\nwinogrande\n85.08%\n84.53%\n99.35%\narc_challenge\n70.39%\n69.20%\n98.30%\nMMLU\n81.66%\n80.20%\n98.21%\nhellaswag\n86.44%\n85.58%\n99.01%\ngsm8k\n92.04%\n91.43%\n99.34%\ntruthfulqa\n59.86%\n58.63%\n97.94%\nxlsum_english\n33.86%\n31.61%\n93.36%\nMMLU Chat\n81.76%\n80.58%\n98.55%\ngsm8k Chat\n81.58%\n81.88%\n100.37%\nInstruct HumanEval (n=20)\n75.85%\n73.84%\n97.35%\nMT Bench\n8.93\n8.99\n100.67%\nTable 2. Accuracy comparison of the Nemotron model to the Llama-3.1-70B-Instruct model across several industry benchmarks\nPerformance\nTable 3 shows the number of tokens per second per GPU (NVIDIA H100 80-GB GPU). You can see that for a range of relevant scenarios, short and long inputs as well as outputs, our model doubles the throughput of the teacher model, making it cost-effective across multiple use cases.\nTPX describes the number of GPUs on which the process runs in parallel. We also list the performance of Llama 3.1-70B on a single GPU to demonstrate the value of our model in such a setting.\nScenario\nInput\/Output Sequence Length\nLlama-3.1- Nemotron-Instruct\nLlama-3.1-70B-Instruct\nRatio\nLlama (TP1)\nChatbot\n128\/128\n5478 (TP1)\n2645 (TP1)\n2.07\n2645\nText generation\n128\/1024\n6472 (TP1)\n2975 (TP4)\n2.17\n1274\nLong text generation\n128\/2048\n4910 (TP2)\n2786 (TP4)\n1.76\n646\nSystem 2 reasoning\n128\/4096\n3855 (TP2)\n1828 (TP4)\n2.11\n313\nSummarization\/ RAG\n2048\/128\n653 (TP1)\n339 (TP4)\n1.92\n300\nStress test 1\n2048\/2048\n2622 (TP2)\n1336 (TP4)\n1.96\n319\nTable 3. Throughput comparison of the number of tokens generated by the models for popular use cases. All numbers are in tokens per second per GPU.\nThe main factor in determining the cost of running a model is\nthroughput\n, the total number of tokens that the system can generate in one second. However, in some scenarios (for example, chatbots), the rate at which a single end user receives the response from the model is important for the user experience. This is quantified by the tokens per second per user, termed the user-side throughput.\nFigure 4 shows this user-side throughput plotted against the throughput at different batch sizes. As seen in all batch sizes, our model is superior to Llama-3.1-70B.\nFigure 4. Server throughput vs. user-side throughput, plotted at different batch sizes for the Nemotron model and for Llama-3.1-70B\nTailoring LLMs for diverse needs\nThe NAS approach offers you flexibility in selecting the optimal balance between accuracy and efficiency. To demonstrate this versatility, we created another variant from the same reference model, this time prioritizing speed and cost. Llama-3.1-Nemotron-40B-Instruct was developed using the same methodology but with a modified speed requirement during the puzzle phase.\nThis model achieves a 3.2x speed increase compared to the parent model, with a moderate decrease in accuracy. Table 4 shows competitive performance metrics.\nAccuracy\nSpeed\nMT bench\nMMLU\nText generation\n(128\/1024)\nSummarization\/ RAG (2048\/128)\nLlama-3.1- Nemotron-40B-Instruct\n8.69\n77.10%\n9568\n862\nLlama-3.1- Nemotron-51B-Instruct\n8.99\n80.20%\n6472\n653\nLlama 3.1-70B-Instruct\n8.93\n81.72%\n2975\n339\nTable 4. Overview of the Llama-3.1-Nemotron-40B-Instruct accuracy and efficiency\nSummary\nLlama 3.1-Nemotron-51B-Instruct\nprovides a new set of opportunities for users and companies that want to use highly accurate foundation models, but do so in a cost-controlled manner. By providing the best tradeoff between accuracy and efficiency, we believe the model is an attractive option for builders. Moreover, these results demonstrate the effectiveness of the NAS approach and intend to extend the method to other models.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/advancing-the-accuracy-efficiency-frontier-with-llama-3-1-nemotron-51b\/","jp_title":"Llama-3.1-Nemotron-51B による精度と効率の前進","jp_content":"Reading Time:\n3\nminutes\n本日、NVIDIA は、比類のない精度と効率を実現する独自の言語モデルを発表しました。 Llama 3.1-Nemotron-51B は、 Meta の Llama-3.1-70B の派生モデルであり、新しい Neural Architecture Search (NAS) アプローチによって、高精度かつ効率的なモデルとなっています。\nこのモデルは高負荷のワークロードでもひとつの NVIDIA H100 GPU に収まるため、より利用しやすく、かつ価格が手頃なモデルとなっています。モデルのアーキテクチャを変更することで、このモデルは精度と効率性の優れたバランスを保っており、高い精度を維持しながら、メモリ使用量やメモリ帯域幅、FLOPs が大幅に削減されています。このアプローチは、さらに小型で高速な別モデルをリファレンス モデルから作成することで、汎用的な手法であることを実証しています。\n2024 年 7 月、Meta は先進的な大規模言語モデル (LLM) である Llama-3.1-70B をリリースしました。本日、NVIDIA は\nLlama 3.1-Nemotron-51B-Instruct\nを発表します。これはリファレンス モデルの Llama-3.1-70B をもとにNAS と知識蒸留を使用することで開発されました。\n優れたスループットとワークロードの効率\nNemotron モデルは、ほぼ同じ精度を維持しながら、リファレンス モデルと比較して 2.2 倍高速な推論が可能です。このモデルは、推論時にひとつの GPU で 4 倍のワークロードを実行可能なほどメモリ使用量を削減しており、これによって新たな用途や可能性が望まれます。\n精度\n効率性\nMT Bench\nMMLU\nテキスト生成 (128\/1024)\n要約 \/ RAG (2048\/128)\nLlama-3.1- Nemotron-51B- Instruct\n8.99\n80.2%\n6472\n653\nLlama 3.1-70B- Instruct\n8.93\n81.66%\n2975\n339\nLlama 3.1-70B- Instruct (GPUは1基のみ)\n—\n—\n1274\n301\nLlama 3-70B\n8.94\n80.17%\n2975\n339\n表 1. Llama-3.1-Nemotron-51B-Instruct の精度と効率性の概要\n注: 速度は GPU 1 基当たりの秒間トークン数で報告されています。8 基の NVIDIA H100 SXM GPU を搭載したマシンで測定。\nTRT-LLM\nをランタイム エンジンとして使用し、FP8 量子化を適用。各モデルに対して、テンソル並列化 (Tensor Parallelism) による最適な数の GPU を使用 (別途記載のない場合)。括弧内の数字は (入力シーケンスの長さ\/出力シーケンスの長さ) を示しています。\n詳細なパフォーマンス指標については、この記事で後述します。\nコスト当たりの精度を最適化\n基盤モデルは、推論や要約などの複雑なタスクを解決する際に、卓越した能力を示しています。しかし、どの上位モデルを使うかを選択する際に大きな課題となっているのが、推論コストです。\n生成 AI 分野の進歩に伴い、精度と効率性(直接的にコストに影響)のバランスが、モデルを選択する際の決定的な要因となるでしょう。さらに、1基の GPU でモデルを実行できることで、デプロイが大幅に簡素化され、エッジ システムからデータ センター、クラウドに至るまでどこでも新たなアプリケーションを実行する機会が開拓されます。加えて、Kubernetes と\nNVIDIA Blueprint\nによる複数のモデルの提供も容易になります。\nそこで、最良のトレードオフを達成するために Llama 3.1-Nemotron-51B-Instruct を作成しました (図 1 )。スループットは価格に反比例するため、最良のトレードオフはグラフに示されている ”Efficient frontier” (効率的であることを示す境界線) 上のモデルが実現しています。図 1 は、今回のモデルである Llama 3.1-Nemotron-51B-Instruct が現在の Efficient frontier をさらに押し上げ、コスト当たりの精度が最も高いモデルであることを示しています。\n図 1. Efficient frontier上のモデルと比較した Llama-3.1-Nemotron-51B の精度とスループットのパフォーマンス。スループットは、NIM で同時実行数 25 (サービング スループット) を用いて測定。\nモデルの品質は、MT-Bench と MMLU (10*MT-Bench + MMLU)\/2 の加重平均として定義され、NVIDIA H100 80GB GPU 1 基当たりのモデル スループットと比較してプロット���れています。グレーの点は最先端のモデルを表し、直線は「Efficient frontier」を表しています。\nNVIDIA NIM による推論の簡素化\nNemotron モデルは、TensorRT-LLM エンジンで最適化され、より高い推論性能を発揮します。また NVIDIA NIM マイクロサービスとしてパッケージ化されており、クラウド、データ センター、ワークステーションなど、NVIDIA により高速化されたインフラ全体で生成 AI モデルのデプロイを効率化および加速します。\nNIM は、推論最適化エンジン、業界標準の API、および構築済みのコンテナを使用して、需要に応じてスケールできる高スループットなAIの推論を可能としています。\nLlama-3.1-Nemotron-51B の NIM マイクロサービス\nを、\nai.nvidia.com\nの API を通じて、無料の NVIDIA クレジットで是非お試しください。\nNAS によるモデルの構築\n推論およびハードウェアを考慮したニューラル ネットワークのアーキテクチャを構築する手法は、多くの分野で成功を収めてきました。しかし、LLM は依然として同一ブロックを繰り返し使用して構成されており、この簡素化により発生する推論コストのオーバーヘッドはほとんど考慮されていません。これらの課題に取り組むために、NVIDIA は、特定の GPU 上で効率的な推論が可能な Transformer モデルを作成する NAS 技術と学習方法を開発しました。\nNVIDIA の技術では、多様な制約を最適化するニューラル ネットワークのアーキテクチャを選択することができます。アーキテクチャの探索範囲は膨大であり、さまざまな Attention や FFN ブロック、極端なケースだとブロックの完全な排除まで含まれます。\n次に、ブロック蒸留 (Block-distillation) フレームワーク (図 2) を使用して、NAS によって見つけたブロックたちを学習します。ブロック蒸留では、生徒 (Student) モデルの各ブロックを教師 (Teacher) モデル の全レイヤーに対して並列で学習します。基本的なブロック蒸留では、学習データはリファレンス モデル (=教師モデル) を通して渡されます。\n生徒モデルの各ブロックは教師モデルの該当するブロックから入力を受け取ります。生徒モデルと教師モデルのブロックの出力が比較され、生徒モデルのブロックは教師モデルのブロックの機能を模倣するように学習されます。また、図 2 の右側のように、生徒モデルの 1 つのブロックが教師モデルの複数のブロックを模倣するように学習する、より発展的なシナリオも考えられます。\n図 2. ブロック蒸留では、青色のリファレンス モデル のブロックたちを生徒モデルのブロックにとっての複数のバリエーションとして扱う。生徒モデルのブロックは教師モデルの機能をブロック単位で模倣。\n次に、NVIDIA の Puzzle アルゴリズムを使用することで、メモリ サイズや必要なスループットなどの推論における制約を遵守しながら、代替の交換パズル ピースを効率的にスコア付けし、最も正確なモデルを膨大な設計スペースから検索します。\n最後に、ブロックのスコアリングとトレーニングの両方に知識蒸留 (KD) 損失を使用することにより、リファレンス モデルの学習コストと比べてごく一部のコストで、はるかに効率的なアーキテクチャがリファレンス モデルとの精度のギャップを縮める可能性を示しました。Llama-3.1-70B をリファレンス モデルとして NVIDIA の方法を使用して、ひとつの NVIDIA H100 GPU に収まるLLM の”Efficient frontier”を上回る Llama-3.1-Nemotron-51B-Instruct (パラメーター数: 51B)を構築しました (図 1)。\nLlama-3.1-Nemotron-51B-Instruct アーキテクチャは、削減または枝刈りされたアテンション層と FFN 層を多く含む不規則なブロック構造が特徴で、その結果 H100 の利用率を向上させ、推論のために LLM を最適化する重要性が示されました。図 3 は、結果として生じるアーキテクチャの不規則な構造を概略的に示しています。図中の緑色部分は計算処理がどれほど削減されるかを強調して示しています。\n図 3. リファレンス モデルの 80 層にわたるアテンション レイヤー (青) と FFN レイヤー (赤) における、 Puzzle アルゴリズムによって選択されたブロック (またはレイヤー) のランタイム。図の緑色の部分は全体的なランタイムの削減に相当。\nNVIDIA の革新的な技術により、LLM の ”Efficient frontier” を再定義する���デルの開発が可能になります。重要なのは、ひとつのリファレンス モデルから複数のモデルを費用対効果に優れた方法で設計し、その結果として各モデルを特定のハードウェアおよび推論のシナリオに最適化できることです。この機能により、現在および将来のハードウェア プラットフォーム全体で、同じ規模の LLM たちの中で最高の推論パフォーマンスを維持することができます。\n詳細な結果\nNVIDIA のモデルの精度とパフォーマンスは以下の通りです。\n精度\n表 2 では、NVIDIA のモデルとリファレンス モデルである Llama-3.1-70B を比較し、評価したすべてのベンチマークについて記載しています。\n維持された精度の割合\nの列は、NVIDIA モデルのスコアと教師モデルのスコアとの比率です。\nベンチマーク\nLlama-3.1 70B-instruct\nLlama-3.1-Nemotron-51B- Instruct\n維持された精度の割合\nwinogrande\n85.08%\n84.53%\n99.35%\narc_challenge\n70.39%\n69.20%\n98.30%\nMMLU\n81.66%\n80.20%\n98.21%\nhellaswag\n86.44%\n85.58%\n99.01%\ngsm8k\n92.04%\n91.43%\n99.34%\ntruthfulqa\n59.86%\n58.63%\n97.94%\nxlsum_english\n33.86%\n31.61%\n93.36%\nMMLU Chat\n81.76%\n80.58%\n98.55%\ngsm8k Chat\n81.58%\n81.88%\n100.37%\nInstruct HumanEval (n=20)\n75.85%\n73.84%\n97.35%\nMT Bench\n8.93\n8.99\n100.67%\n表 2. 複数の業界標準のベンチマークにおける Nemotron モデルと Llama-3.1-70B-Instruct モデルの精度比較\nパフォーマンス\n表 3 は、GPU (NVIDIA H100 80GB GPU) 1 基あたりのトークン数を示しています。関連するシナリオの範囲、短い入力と長い入力および出力に関して、NVIDIA のモデルは教師モデルのスループットを 2 倍に高め、複数のユース ケースで費用対効果が高いことがわかります。\nTPX は、プロセスを並列処理する GPU の数を表します。また、このような設定における NVIDIA のモデルの価値を示すため、単一の GPU 上の Llama 3.1-70B のパフォーマンスも記載しています。\nシナリオ\n入出力シーケンス長\nLlama-3.1- Nemotron-Instruct\nLlama-3.1-70B-Instruct\n比率\nLlama (TP1)\nチャットボット\n128\/128\n5478 (TP1)\n2645 (TP1)\n2.07\n2645\nテキスト生成\n128\/1024\n6472 (TP1)\n2975 (TP4)\n2.17\n1274\n長いテキスト生成\n128\/2048\n4910 (TP2)\n2786 (TP4)\n1.76\n646\nシステム 2 の推論\n128\/4096\n3855 (TP2)\n1828 (TP4)\n2.11\n313\n要約 \/ RAG\n2048\/128\n653 (TP1)\n339 (TP4)\n1.92\n300\nストレス テスト 1\n2048\/2048\n2622 (TP2)\n1336 (TP4)\n1.96\n319\n表 3. 一般的なユース ケースのモデルにより生成されたトークン数のスループット比較。すべての数値は、GPU ごとの 1 秒あたりのトークン数を示します。\nモデルの実行コストを決定する主な要因は、システムが 1 秒間に生成できるトークンの合計数であるスループットです。しかし、いくつかのシナリオ (チャットボットなど) では、1 人のエンドユーザーがモデルからの応答を受け取る速度というのがユーザー体験の観点から重要になります。これはユーザーごとの 1 秒間のトークン数で定量化され、ユーザー側のスループット (User-side throughput) と呼ばれます。\n図 4 は、このユーザー側のスループットを、異なるバッチ サイズのスループットに対してプロットしたものです。全てのバッチ サイズで確認できるように、NVIDIA のモデルは Llama-3.1-70B よりも優れています。\n図 4. Nemotron モデルと Llama-3.1-70B の異なるバッチ サイズでプロットしたサーバーのスループットとユーザー側のスループット\n多様なニーズに合わせた LLM のカスタマイズ\nNAS アプローチには、精度と効率性の最適なバランスを選択できる柔軟性があります。この汎用性を示すため、同じリファレンス モデルから別のモデルを作成しました。ここでは速度とコストを優先しました。Llama-3.1-Nemotron-40B-Instruct は同じ手法を用いて開発されましたが、パズル段階における速度の要件が変更されています。\nこのモデルは、親モデルと比較して 3.2 倍の速度向上を達成しますが、精度は若干低下しています。表 4 からもこのモデルが十分なパフォーマンスを示していることがわかります。\n精度\n速度\nMT bench\nMMLU\nテキスト生成 (128\/1024)\n要約 \/ RAG (2048\/128)\nLlama-3.1- Nemotron-40B-Instruct\n8.69\n77.10%\n9568\n862\nLlama-3.1- Nemotron-51B-Instruct\n8.99\n80.20%\n6472\n653\nLlama 3.1-70B-Instruct\n8.93\n81.72%\n2975\n339\n表 4. Llama-3.1-Nemotron-40B-Instruct の精度と効率の概要\nまとめ\nLlama 3.1-Nemotron-51B-Instruct\nは、高精度の基盤モデルを使いつつ、コスト��抑えたいユーザーや企業にとって、新たなチャンスとなります。このモデルは精度と効率性の最適なバランスを備えており、開発者にとって魅力的な選択肢になると思います。さらに、ここで示した結果は NAS アプローチの有効性を示しており、他のモデルに対してもこの方法を拡張することにもつながります。\n関連情報\nGTC セッション:\n地震データ処理ワークフローに対する AI アシスタント統合を先駆けて実現\nGTC セッション:\n大規模言語モデルの最適化: LLama2 7B のプルーニングとファインチューニングに向けた実験的アプローチ\nNGC コンテナー:\nLlama-3.1-405b-instruct\nNGC コンテナー:\nLlama-3-Swallow-70B-Instruct-v0.1\nSDK:\nLlama3 8B Instruct NIM"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/transforming-financial-analysis-with-nvidia-nim\/","en_title":"Transforming Financial Analysis with NVIDIA NIM","en_content":"In financial services, portfolio managers and research analysts diligently sift through vast amounts of data to gain a competitive edge in investments. Making informed decisions requires access to the most pertinent data and the ability to quickly synthesize and interpret that data.\nTraditionally, sell-side analysts and fundamental portfolio managers have focused on a small subset of companies, meticulously examining financial statements, earning calls, and corporate filings. Systematically analyzing financial documents across a larger trading universe can uncover additional insights. Due to the technical and algorithmic difficulty of such tasks, systematic analysis of transcripts over a wide trading universe was, until recently, only accessible to sophisticated quant-trading firms.\nThe performance achieved on these tasks using traditional\nnatural language processing (NLP)\nmethods such as bag-of-words, sentiment dictionaries, and word statistics, often falls short when compared to the capabilities of\nlarge language models (LLMs)\nin financial NLP tasks. Besides financial applications, LLMs have demonstrated superior performance in domains like medical document understanding, news article summarization, and legal document retrieval.\nBy leveraging AI and NVIDIA technology, sell-side analysts, fundamental traders, and retail traders can significantly accelerate their research workflow, extract more nuanced insights from financial documents, and cover more companies and industries. By adopting these advanced AI tools, the financial services sector can enhance its data analysis capabilities, saving time and improving the accuracy of investment decisions. According to the NVIDIA\n2024 State of AI in Financial Services\nsurvey report, 37% of respondents are exploring generative AI and LLMs for report generation, synthesis, and investment research to reduce repetitive manual work.\nIn this post, we’ll walk you through an end-to-end demo on how to build an AI assistant to extract insights from earnings call transcripts using\nNVIDIA NIM\ninference microservices to implement a\nretrieval-augmented generation (RAG)\nsystem. We’ll highlight how leveraging advanced AI technologies can accelerate workflows, uncover hidden insights, and ultimately enhance decision-making processes in the financial services industry.\nAnalyzing earnings call transcripts with NIM microservices\nEarnings calls in particular are a vital source for investors and analysts, providing a platform for companies to communicate important financial and business information. These calls offer insights into the industry, the company’s products, competitors, and most importantly, its business prospects.\nBy analyzing earnings call transcripts, investors can glean valuable information about a company’s future earnings and valuation. Earnings call transcripts have successfully been used to generate alpha for over two decades. For more details, see\nNatural Language Processing – Part I: Primer\nand\nNatural Language Processing – Part II: Stock Selection\n.\nStep 1: The data\nIn this demo, we use transcripts from NASDAQ earnings calls from 2016 to 2020 for our analysis. This\nEarnings Call Transcripts dataset\ncan be downloaded from Kaggle.\nFor our evaluation, we used a subset of 10 companies from which we then randomly selected 63 transcripts for manual annotation. For all transcripts, we answered the following set of questions:\nWhat are the company’s primary revenue streams and how have they changed over the past year?\nWhat are the company’s major cost components and how have they fluctuated in the reporting period?\nWhat capital expenditures were made and how are these supporting the company’s growth?\nWhat dividends or stock buybacks were executed?\nWhat significant risks are mentioned in the transcript?\nThis makes for a total of 315 question-answer pairs. All questions are answered using a structured\nJSON format\n. For example:\nQuestion: What are the company’s primary revenue streams and how have they changed over the past year?\nAnswer:\n{ \n \"Google Search and Other advertising\": { \n\t\"year_on_year_change\": \"-10%\", \n\t\"absolute_revenue\": \"21.3 billion\", \n\t\"currency\": \"USD\" \n }, \n \"YouTube advertising\": { \n\t\"year_on_year_change\": \"6%\", \n\t\"absolute_revenue\": \"3.8 billion\", \n\t\"currency\": \"USD\" \n }, \n \"Network advertising\": { \n\t\"year_on_year_change\": \"-10%\", \n\t\"absolute_revenue\": \"4.7 billion\", \n\t\"currency\": \"USD\" \n }, \n \"Google Cloud\": { \n\t\"year_on_year_change\": \"43%\", \n\t\"absolute_revenue\": \"3 billion\", \n\t\"currency\": \"USD\" \n }, \n \"Other revenues\": { \n\t\"year_on_year_change\": \"26%\", \n\t\"absolute_revenue\": \"5.1 billion\", \n\t\"currency\": \"USD\" \n } \n}\nUsing JSON enables evaluating model performance in a manner that does not rely on subjective language understanding methods, such as\nLLM-as-a-judge\n, which might introduce unwanted biases into the evaluation.\nStep 2: NVIDIA NIM\nThis demo uses\nNVIDIA NIM\n, a set of microservices designed to speed up enterprise\ngenerative AI\ndeployment. For more details, see\nNVIDIA NIM Offers Optimized Inference Microservices for Deploying AI Models at Scale\n. Supporting a wide range of AI models, including NVIDIA-optimized community and commercial partner models, NIM ensures seamless, scalable AI inferencing, on-premises or in the cloud, leveraging industry-standard APIs.\nWhen ready for production, NIM microservices are deployed with a single command for easy integration into enterprise-grade AI applications using standard APIs and just a few lines of code. Built on robust foundations including inference engines like\nNVIDIA TensorRT\n, TensorRT-LLM, and PyTorch, NIM is engineered to facilitate seamless AI inferencing with best performance out-of-the-box based on the underlying hardware. Self-hosting models with NIM supports the protection of customer and enterprise data, which is a common requirement in RAG applications.\nStep 3: Setting up on NVIDIA API catalog\nNIM microservices can be accessed using the NVIDIA API catalog. All it takes to set up is registering an NVIDIA API key (From the\nAPI catalog\n, click Get API Key.) For the purposes of this post, we’ll store it in an environment variable:\nexport NVIDIA_API_KEY=YOUR_KEY\nLangChain provides a package for\nconvenient NGC integration\n. This tutorial will use endpoints to run embedding, reranking, and chat models with NIM microservices. To reproduce the code, you’ll need to install the following Python dependencies:\nlangchain-nvidia-ai-endpoints==0.1.2 \nfaiss-cpu==1.7.4 \nlangchain==0.2.5 \nunstructured[all-docs]==0.11.2\nStep 4: Building a RAG pipeline with NIM microservices\nRAG is a method that enhances language models by combining retrieval of relevant documents from a large corpus with text generation.\nThe first step of RAG is to vectorize your collection of documents. This involves taking a series of documents, splitting them into smaller chunks, using an embedder model to turn each of these chunks into a neural network embedding (a vector), and storing them in a\nvector database\n.\nWe’ll do this for each of the earning calls transcripts:\nimport os \nfrom langchain.text_splitter import RecursiveCharacterTextSplitter \nfrom langchain.document_loaders import TextLoader \nfrom langchain.vectorstores import FAISS \nfrom langchain_nvidia_ai_endpoints import NVIDIAEmbeddings \n \n# Initialise the embedder that converts text to vectors \ntranscript_embedder = NVIDIAEmbeddings(model='nvidia\/nv-embed-v1', \n truncate='END' \n ) \n \n# The document we will be chunking and vectorizing \ntranscript_fp = \"Transcripts\/GOOGL\/2020-Feb-03-GOOGL.txt\" \nraw_document = TextLoader(transcript_fp).load() \n# Split the document into chunks of 1500 characters each \ntext_splitter = RecursiveCharacterTextSplitter(chunk_size=3000, \n chunk_overlap=200) \ndocuments = text_splitter.split_documents(raw_document) \n# Vectorise each chunk into a separate entry in the database \nvectorstore = FAISS.from_documents(documents, transcript_embedder) \nvector_store_path = \"vector_db\/google_transcript_2020_feb.pkl\" \ntry: \n os.remove(vector_store_path) \nexcept OSError: \n pass \nvectorstore.save_local(vector_store_path)\nOnce the vectorized database is built, the simplest RAG flow for the earning calls transcripts is as follows:\nA user inputs a\nquery.\nFor example, “What are the company’s main revenue sources?”\nThe\nembedder\nmodel embeds the query into a vector and then searches through the vectorized database of the documents for the Top-K (Top-30, for example) most relevant chunks.\nA\nreranker\nmodel, also known as a cross-encoder, then outputs a similarity score for each query-document pair. Additionally, metadata can also be used to help improve the accuracy of the reranking step. This score is used to reorder the Top-K documents retrieved by the embedder by relevance to the user query. Further filtering can then be applied, retaining only the Top-N (Top-10, for example) documents.\nThe Top-N most relevant documents are then passed onto an\nLLM\nalongside the user query. The retrieved documents are used as context to ground the model’s answer.\nFigure 2. A simplified RAG workflow that involves three main steps: embedding and retrieval, reranking, and context-grounded LLM answer generation\nNote that modifications can be made to improve a model’s answer accuracy, but for now we’ll continue with the simplest robust approach.\nConsider the following user query and desired JSON format:\nquestion = \"What are the company’s primary revenue streams and how have they changed over the past year?\" \n \njson_template = \"\"\" \n{\"revenue_streams\": [ \n { \n \"name\": \"\", \n \"amount\": , \n \"currency\": \"\", \n \"percentage_change\": \n }, \n { \n \"name\": \"\", \n \"amount\": , \n \"currency\": \"\", \n \"percentage_change\": \n }, \n \/\/ Add more revenue streams as needed \n] \n} \n\"\"\" \n \nuser_query = question + json_template\nThe JSON template will be used so that, further down the pipeline, the LLM knows to output its answer in valid JSON, rather than in plain text. As mentioned in Step 1, using JSON enables the automated evaluation of model answers in an objective manner. Note that this could be removed if a more conversational style is preferred.\nTo contextualize the user query, initialize the Embedder and the Reranker for the retrieval and ordering of the relevant documents:\nfrom langchain_nvidia_ai_endpoints import NVIDIARerank \nfrom langchain.retrievers.contextual_compression import ContextualCompressionRetriever \n \n# How many retrieved documents to keep at each step \ntop_k_documents_retriever = 30 \ntop_n_documents_reranker = 5 \n# Initialie retriever for vector database \nretriever = vectorstore.as_retriever(search_type='similarity', \n search_kwargs={'k': top_k_documents_retriever}) \n# Add a reranker to reorder documents by relevance to user query \nreranker = NVIDIARerank(model=\"ai-rerank-qa-mistral-4b\", \n top_n=top_n_documents_reranker) \nretriever = ContextualCompressionRetriever(base_compressor=reranker, \n base_retriever=retriever) \n# Retrieve documents, rerank them and pick top-N \nretrieved_docs = retriever.invoke(user_query) \n# Join all retrieved documents into a single string \ncontext = \"\" \nfor doc in retrieved_docs: \n context += doc.page_content + \"\\n\\n\"\nThen, when the relevant documents are retrieved, they can be passed onto the LLM alongside the user query. We are using the\nLlama 3 70B\nNIM:\nfrom langchain_nvidia_ai_endpoints import ChatNVIDIA \n \nPROMPT_FORMAT = \"\"\"\" \nGiven the following context: \n \n#################### \n{context} \n#################### \n \nAnswer the following question: \n{question} \n \nusing the following JSON structure: \n \n{json_template} \n \nFor amounts don't forget to always state if it's in billions or millions and \"N\/A\" if not present. \nOnly use information and JSON keys that are explicitly mentioned in the transcript. \nIf you don't have information for any of the keys use \"N\/A\" as a value. \nAnswer only with JSON. Every key and value in the JSON should be a string. \n\"\"\" \n \nllm = ChatNVIDIA(model=\"ai-llama3-70b\", \n max_tokens=600, \n temperature=0\n ) \n \nllm_input = PROMPT_FORMAT.format(**{\"context\": context, \n \"question\": question, \n \"json_template\": json_template \n }) \nanswer = llm.invoke(llm_input) \nprint(answer.content)\nRunning this code will produce a JSON-structured answer to the user query. The code can now be easily modified to read in multiple transcripts and answer varying user queries.\nStep 5: Evaluation\nTo evaluate the performance of the retrieval step, use the annotated question-answer pairs previously described to compare the ground-truth JSON with the predicted JSON, key-by-key. Consider the following ground-truth example:\n\"Google Cloud\": { \n \"year_on_year_change\": \"43%\", \n \"absolute_revenue\": \"3 billion\", \n \"currency\": \"N\/A\" \n}\nThe prediction looks like this:\n\"Google Cloud\": { \n\t\"year_on_year_change\": \"43%\", \n\t\"absolute_revenue\": \"N\/A\", \n\t\"currency\": \"USD\" \n}\nThe three possible outcomes are:\nTrue positive (TP)\n: There is no value to extract, and the ground truth and the prediction match. For the previous example, the prediction for\nyear_on_year_change\nis TP.\nFalse Positive (FP)\n: The ground truth value is\n“N\/A”\n. In other words, there is no value to extract, but the prediction hallucinates a value. For the previous example, the prediction for\ncurrency\nis FP.\nFalse Negative (FN)\n: There is a ground truth value to extract, however, the prediction fails to capture that value. For the previous example, the prediction for\nabsolute_revenue\nis FP.\nWith these outcomes measured, next calculate the following three main metrics:\nRecall\n= TP\/ (TP + FN): Higher recall implies our model is returning more and more of the relevant results.\nPrecision\n= TP \/ (TP + FP): Higher precision implies our model returns a higher ratio of relevant results versus irrelevant ones.\nF1-score\n= (2 * Precision * Recall) \/ (Precision + Recall): The F1-score is a harmonic mean of precision and recall.\nA user might want to be partially flexible with the matching of non-numeric values when doing string comparisons for some of the attributes. For example, consider a question about revenue sources, where one of the ground-truth answers is “Data Centers” and the model outputs “Data Center”. An exact match evaluation would treat this as a mismatch. To achieve more robust evaluation in such cases, use fuzzy matching with the Python default\ndifflib\n:\nimport difflib\n\n\ndef get_ratio_match(gt_string, pred_string):\n if len(gt_string) < len(pred_string):\n min_len = len(gt_string)\n else:\n min_len = len(pred_string)\n matcher = difflib.SequenceMatcher(None, gt_string, pred_string, autojunk=False)\n _, _, longest_match = matcher.find_longest_match(0, min_len, 0, min_len)\n # Return the ratio of match with ground truth\n return longest_match \/ min_len\nFor evaluation, consider any string attributes to be a match if their similarity ratio is above 90%.\nTable 1 presents results for two of the most-used open-source model families (Mistral AI Mixtral models and Meta Llama 3 models) on our manually annotated data. For both model families, there is noticeable performance deterioration when lowering the number of parameters. Visit the\nNVIDIA API catalog\nto experience these NIM microservices.\nMethod\nF1\nPrecision\nRecall\nLlama 3 70B\n84.4%\n91.3%\n78.5%\nLlama 3 8B\n75.8%\n85.2%\n68.2%\nMixtral 8x22B\n84.4%\n91.9%\n78.0%\nMixtral 8x7B\n62.2%\n80.2%\n50.7%\nTable 1. Performance of Llama and Mixtral models on JSON-structured information extraction and question-answering from earning call transcripts\nMixtral-8x22B seems to have roughly equivalent performance to Llama 3 70B. However, for both model families, reducing the number of parameters does result in a significant decrease in performance. A decrease is most accentuated for Recall. This presents a frequent trade-off between choosing to have better accuracy at the cost of larger hardware requirements.\nIn most cases, model accuracy can be improved without increasing the number of parameters, by fine-tuning either the Embedder, Reranker, or the LLM using domain-specific data (in this case, earning call transcripts).\nThe Embedder is the smallest and therefore the quickest and most cost-effective to fine-tune. For detailed instructions, refer to the\nNVIDIA NeMo documentation\n. Additionally,\nNVIDIA NeMo\nsimplifies and enhances the efficiency of fine-tuning an effective version of the LLM.\nKey implications for users\nThis demo is designed to extract insights from earnings call transcripts. By leveraging advanced AI technologies like NIM, it’s now possible to quickly and accurately retrieve information from earnings call transcripts. The AI product assists multiple categories of financial researchers, analysts, advisors, and fundamental portfolio managers during the most intensive processes of documentation and data analysis, enabling financial professionals to spend more time on strategic decision-making or with clients.\nIn the asset management sector, for example, portfolio managers can use the assistant to quickly synthesize insights from a vast number of earnings calls, improving investment strategies and outcomes. In the insurance industry, the AI assistant can analyze financial health and risk factors from company reports, enhancing underwriting and risk assessment processes. In fundamental and retail trading, the assistant can help with systematic information extraction to identify market trends and sentiment shifts, enabling the use of more detailed information for future trades.\nEven in banking, it can be used to assess the financial stability of potential loan recipients by analyzing their earnings calls. Ultimately, this technology enhances efficiency, accuracy, and the ability to make data-driven decisions, giving users a competitive edge in their respective markets.\nVisit the\nNVIDIA API catalog\nto see all the available NIM microservices and experiment with\nLangChain’s convenient integration\nto see what works best for your own data.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/transforming-financial-analysis-with-nvidia-nim\/","jp_title":"NVIDIA NIM による財務分析の変革","jp_content":"Reading Time:\n4\nminutes\n金融サービスでは、ポートフォリオ マネージャーやリサーチ アナリストが���大な量のデータを丹念に精査し、投資で競争力を高めています。情報に基づいた意思決定を行うには、最も関連性の高いデータにアクセスし、そのデータを迅速に統合して解釈する能力が必要です。\n従来、セルサイド アナリストやファンダメンタル ポートフォリオ マネージャーは、財務諸表、収益報告、企業提出書類を綿密に調べ、一部の企業に焦点を当ててきました。より広範な取引対象範囲にわたって財務文書を体系的に分析することで、さらなる洞察を得ることができます。このようなタスクは技術的およびアルゴリズム的に難しいため、広範な取引対象範囲にわたるトランスクリプトの体系的な分析は、最近まで、高度なクオンツ トレーディング (quant-trading) 会社にしかできませんでした。\nこれらのタスクで、バッグオブワード、感情辞書、単語統計などの従来の\n自然言語処理 (NLP)\n手法を使用して達成されるパフォーマンスは、金融 NLP タスクにおける\n大規模言語モデル (LLM)\nの機能と比較すると、しばしば不十分です。金融アプリケーション以外にも、LLM は医療文書の理解、ニュース記事の要約、法的文書の検索などの分野で優れたパフォーマンスを発揮しています。\nAI と NVIDIA のテクノロジを活用することで、セルサイド アナリスト、ファンダメンタル トレーダー、リテール トレーダーはリサーチ ワークフローを大幅に加速し、金融文書からより微妙な洞察を抽出し、より多くの企業や業界をカバーできます。これらの高度な AI ツールを導入することで、金融サービス部門はデータ分析機能を強化し、時間を節約し、投資決定の精度を向上させることができます。\nNVIDIA の 2024 年金融サービス\nにおける AI の現状調査レポートによると、回答者の 37% (中国を除く) が、反復的な手作業を減らすために、レポート生成、統合合成、投資調査のための生成 AI と LLM を検討しています。\nこの記事では、\nNVIDIA NIM\n推論マイクロサービスを使用して収益報告のトランスクリプトから洞察を抽出する AI アシスタントを構築し、\n検索拡張生成 (RAG)\nシステムを実装する方法について、エンドツーエンドのデモで説明します。高度な AI テクノロジを活用することで、ワークフローを加速し、隠れた洞察を明らかにし、最終的に金融サービス業界の意思決定プロセスを強化する方法を紹介します。\nNIM による収益報告の記録の分析\n特に、決算発表の電話会議は投資家やアナリストにとって重要な情報源であり、企業が重要な財務情報や事業情報を伝達するプラットフォームを提供します。これらの電話会議は、業界、企業の製品、競合他社、そして最も重要な事業見通しについての洞察を提供します。\n決算発表の電話会議の記録を分析することで、投資家は企業の将来の収益と評価に関する貴重な情報を収集できます。決算発表の電話会議の記録は、20 年以上にわたってアルファを生み出すために効果的に使用されてきました。詳細については、\n「自然言語処理 – パート I: 入門」\n(2017 年 9 月) および\n「自然言語処理 – パート II: 銘柄選択」\n(2018 年 9 月)を参照してください。\nステップ 1: データ\nこのデモでは、2016 年から 2020 年までの NASDAQ の収益報告のトランスクリプトを分析に使用します。この\n収益報告のトランスクリプト データセット\nは、Kaggle からダウンロードできます。\n評価では、10 社のサブセットを使用し、そこから 63 件のトランスクリプトをランダムに選択して手動で注釈を付けました。すべてのトランスクリプトについて、次の一連の質問に答えました:\n会社の主な収益源は何ですか。過去 1 年間でどのように変化しましたか?\n会社の主なコスト要素は何ですか。報告期間中にどのように変動しましたか?\nどのような設備投資が行われ、それがどのように会社の成長を支えていますか?\nどのような配当または株式買い戻しが実行されましたか?\nトランスクリプトで言及されている重要なリスクは何ですか?\nこれにより、合計 315 の質問と回答のペアが作成されます。すべての質問への回答は、構造化された\nJSON フォーマット\nを使用して行われます。\nたとえば:\n質問: 会社の主な収入源は何ですか? また、過去 1 年間でどのように変化しましたか? (What are the company’s primary revenue streams and how have they changed over the past year?)\n回答:\n{ \n \"Google Search and Other advertising\": { \n \"year_on_year_change\": \"-10%\", \n \"absolute_revenue\": \"21.3 billion\", \n \"currency\": \"USD\"\n }, \n \"YouTube advertising\": { \n \"year_on_year_change\": \"6%\", \n \"absolute_revenue\": \"3.8 billion\", \n \"currency\": \"USD\"\n }, \n \"Network advertising\": { \n \"year_on_year_change\": \"-10%\", \n \"absolute_revenue\": \"4.7 billion\", \n \"currency\": \"USD\"\n }, \n \"Google Cloud\": { \n \"year_on_year_change\": \"43%\", \n \"absolute_revenue\": \"3 billion\", \n \"currency\": \"USD\"\n }, \n \"Other revenues\": { \n \"year_on_year_change\": \"26%\", \n \"absolute_revenue\": \"5.1 billion\", \n \"currency\": \"USD\"\n } \n}\nJSON を使用すると、評価に望ましくないバイアスを導入する可能性のある「\nLLM 断言\n」などの主観的な言語理解方法に依存せずにモデルのパフォーマンスを評価できます。\nステップ 2: NVIDIA NIM\nこのデモでは、エンタープライズ生成 AI の導入を高速化するために設計されたマイクロサービス セットである\nNVIDIA NIM\nを使用します。詳細については、\n「NVIDIA NIM は AI モデルの大規模な導入向けに最適化された推論マイクロサービスを提供します」\nを参照してください。\nNVIDIA 向けに最適化されたコミュニティ モデルや商用パートナー モデルなど、幅広い AI モデルをサポートする NIM は、業界標準の API を活用して、オンプレミスまたはクラウドでシームレスでスケーラブルな AI 推論を実現します。実稼働の準備ができたら、NIM は 1 つのコマンドで導入され、標準 API とわずか数行のコードを使用してエンタープライズ グレードの AI アプリケーションに簡単に統合できます。\nNVIDIA TensorRT\n、TensorRT-LLM、PyTorch などの推論エンジンを含む堅牢な基盤上に構築された NIM は、基盤となるハードウェアに基づいてすぐに最高のパフォーマンスでシームレスな AI 推論を実現するように設計されています。NIM を使用したセルフホスティング (self-hosting) モデルは、RAG アプリケーションで一般的な要件である顧客データと企業データの保護をサポートします。\nステップ 3: NVIDIA API カタログでの設定\nNIM には、\nNVIDIA API カタログ\nを使用してアクセスできます。設定に必要なのは、NVIDIA API キーを登録することだけです (API カタログから、[API キーの取得] をクリックします)。この記事では、これを環境変数に保存します。\nexport NVIDIA_API_KEY=YOUR_KEY\nLangChain は、\n便利な NGC 統合\n用のパッケージを提供しています。このチュートリアルでは、エンドポイントを使用して、NIM で埋め込み、リランキング、チャット モデルを実行します。コードを再現するには、次の Python 依存関係をインストールする必要があります。\nlangchain-nvidia-ai-endpoints==0.1.2\nfaiss-cpu==1.7.4\nlangchain==0.2.5\nunstructured[all-docs]==0.11.2\nステップ 4: NIM を使用した RAG パイプラインの構築\nRAG は、大規模なコーパスからの関連文書の取得とテキスト生成を組み合わせることで言語モデルを強化する方法です。\nRAG の最初のステップは、文書のコレクションをベクトル化することです。これには、一連の文書を取得し、それらを小さなチャンクに分割し、埋め込みモデルを使用してこれらの各チャンクをニューラル ネットワーク埋め込み (ベクトル) に変換し、\nベクトル データベース\nに保存することが含まれます。各収益報告通話のトランスクリプトに対してこれらの操作を実行します。\nimport os \nfrom langchain.text_splitter import RecursiveCharacterTextSplitter \nfrom langchain.document_loaders import TextLoader \nfrom langchain.vectorstores import FAISS \nfrom langchain_nvidia_ai_endpoints import NVIDIAEmbeddings \n \n# Initialise the embedder that converts text to vectors \ntranscript_embedder = NVIDIAEmbeddings(model='nvidia\/nv-embed-v1', \n truncate='END'\n ) \n \n# The document we will be chunking and vectorizing \ntranscript_fp = \"Transcripts\/GOOGL\/2020-Feb-03-GOOGL.txt\"\nraw_document = TextLoader(transcript_fp).load() \n# Split the document into chunks of 1500 characters each \ntext_splitter = RecursiveCharacterTextSplitter(chunk_size=3000, \n chunk_overlap=200) \ndocuments = text_splitter.split_documents(raw_document) \n# Vectorise each chunk into a separate entry in the database \nvectorstore = FAISS.from_documents(documents, transcript_embedder) \nvector_store_path = \"vector_db\/google_transcript_2020_feb.pkl\"\ntry: \n os.remove(vector_store_path) \nexcept OSError: \n pass\nvectorstore.save_local(vector_store_path)\nベクトル化されたデータベースが構築されると、収益報告の記録の最も単純な RAG フローは次のようになります。\nユーザーが\nクエリ (query)\nを入力します。たとえば、「会社の主な収益源は何ですか?」(What are the company’s main revenue sources?)\n埋め込みモデル (embedder)\nはクエリをベクトルに埋め込み、ドキュメントのベクトル化されたデータベースを検索して、最も関連性の高い上位 K (例えば、上位 30 など) のチャンクを探します。\n次に、クロスエンコーダーとも呼ばれる\nリランキング (reranker)\nモデルが、クエリとドキュメントの各ペアの類似性スコアを出力します。さらに、メタデータを使用して、再ランク付けステップの精度を向上させることもできます。このスコアは、埋め込みによって取得された上位 K のドキュメントを、ユーザー クエリとの関連性で並べ替えるために使用されます。その後、さらにフィルタリングを適用して、上位 N (例えば、上位 10 など) のドキュメントのみを保持できます。\n次に、最も関連性の高い上位 N のドキュメントが、ユーザークエリとともに\nLLM\nに渡されます。取得されたドキュメントは、モデルの回答を基盤付けるコンテキストとして使用されます。\n図1. 埋め込みと検索、リランキング、コンテキストに基づいた LLM 回答生成という 3 つの主要なステップを含む簡略化された RAG ワークフロー\nモデルの回答精度を向上させるために変更を加えることもできますが、今のところは最もシンプルで堅牢なアプローチを続けます。\n次のユーザー クエリと必要な JSON フォーマットを検討してください。\nquestion = \"What are the company’s primary revenue streams and how have they changed over the past year?\"\n\n# 会社の主な収入源は何ですか? また、過去 1 年間でどのように変化しましたか?\n \njson_template = \"\"\" \n{\"revenue_streams\": [ \n { \n \"name\": \"\", \n \"amount\": , \n \"currency\": \"\", \n \"percentage_change\": \n }, \n { \n \"name\": \"\", \n \"amount\": , \n \"currency\": \"\", \n \"percentage_change\": \n }, \n \/\/ Add more revenue streams as needed \n] \n} \n\"\"\"\n \nuser_query = question + json_template\nJSON テンプレートは、パイプラインのさらに先で、LLM がプレーン テキストではなく有効な JSON フォーマットで回答を出力することを認識できるように使用されます。ステップ 1 で述べたように、JSON を使用すると、客観的な方法でモデル回答を自動的に評価できます。より「会話的なスタイル」が望ましい場合は、これを削除できることに注意してください。\nユーザー クエリをコンテキスト化するには、関連するドキュメントを取得して順序付けするために、Embedder (埋め込みモデル) と Reranker (リランキングモデル) を初期化します:\nfrom langchain_nvidia_ai_endpoints import NVIDIARerank\nfrom langchain.retrievers.contextual_compression import ContextualCompressionRetriever\n \n# 1 How many retrieved documents to keep at each step, 各ステップで取得されたドキュメントをいくつ保存するかの設定:\ntop_k_documents_retriever = 30\ntop_n_documents_reranker = 5\n# 2 Initialize retriever for vector database, ベクトルデータベースの取得を初期化する:\nretriever = vectorstore.as_retriever(search_type='similarity',\n search_kwargs={'k': top_k_documents_retriever})\n# 3 Add a reranker to reorder documents by relevance to user query, ユーザークエリとの関連性に基づいてドキュメントを並べ替えるリランキング機能を追加する:\nreranker = NVIDIARerank(model=\"ai-rerank-qa-mistral-4b\",\n top_n=top_n_documents_reranker)\nretriever = ContextualCompressionRetriever(base_compressor=reranker,\n base_retriever=retriever)\n# 4 Retrieve documents, rerank them and pick top-N, ドキュメントを取得し、リランキングして上位Nを選択する:\nretrieved_docs = retriever.invoke(user_query)\n# 5 Join all retrieved documents into a single string, 取得したすべてのドキュメントを1つの文字列��結合する:\ncontext = \"\"\nfor doc in retrieved_docs:\n context += doc.page_content + \"\\n\\n\"\n次に、関連するドキュメントが取得されると、ユーザー クエリとともに LLM に渡されます。ここでは、\nLlama 3 70B\nNIM を使用しています。\nfrom langchain_nvidia_ai_endpoints import ChatNVIDIA\n \nPROMPT_FORMAT = \"\"\"\"\nGiven the following context:\n \n####################\n{context}\n####################\n \nAnswer the following question:\n{question}\n \nusing the following JSON structure:\n \n{json_template}\n \nFor amounts don't forget to always state if it's in billions or millions and \"N\/A\" if not present.\nOnly use information and JSON keys that are explicitly mentioned in the transcript.\nIf you don't have information for any of the keys use \"N\/A\" as a value. \nAnswer only with JSON. Every key and value in the JSON should be a string.\n\"\"\"\n \nllm = ChatNVIDIA(model=\"ai-llama3-70b\",\n max_tokens=600,\n temperature=0\n )\n \nllm_input = PROMPT_FORMAT.format(**{\"context\": context,\n \"question\": question,\n \"json_template\": json_template\n })\nanswer = llm.invoke(llm_input)\nprint(answer.content)\nこのコードを実行すると、ユーザー クエリに対する JSON 構造の回答が生成されます。コードを簡単に変更して、複数のトランスクリプトを読み込んでさまざまなユーザー クエリに回答できるようになりました。\nステップ 5: 評価\n検索ステップのパフォーマンスを評価するには、前述の注釈付きの質問と回答のペアを使用して、真実の JSON と予測された JSON をキーごとに比較します。次の真実の例を考えてみましょう。\n\"Google Cloud\": {\n \"year_on_year_change\": \"43%\",\n \"absolute_revenue\": \"3 billion\",\n \"currency\": \"N\/A\"\n}\n予測の出力は次のようになります:\n\"Google Cloud\": { \n \"year_on_year_change\": \"43%\", \n \"absolute_revenue\": \"N\/A\", \n \"currency\": \"USD\"\n}\n考えられる出力の評価結果は 3 つあります。\n真陽性 (TP, True Positive)\n: 参考の答えと予測が一致しています。前の例では、\nyear_on_year_change\nの予測 (“43%”) は TP です。\n偽陽性 (FP, False Positive)\n: 参考の答えの値は\n\"N\/A\"\nです。つまり、抽出する値はありませんが、予測では値が幻覚的に表示されます。前の例では、\ncurrency\nの予測 (“USD”) は FP です。\n偽陰性 (FN, False Negative)\n: 抽出する参考の答えの値がありますが、予測ではその値を取得できませんでした。前の例では、\nabsolute_revenue\nの予測 (“N\/A”) は FP です。\nこれらの結果を測定したら、次に、次の 3 つの主要なメトリックを計算します。\n再現率 (Recall)\n= TP\/ (TP + FN): 再現率が高いほど、モデルが関連する結果をより多く返していることを意味します。\n精度 (Precision)\n= TP \/ (TP + FP): 精度が高いほど、モデルが関連する結果と無関係な結果の比率が高くなっていることを意味します。\nF1 スコア (F1-score)\n= (2 * 適合率 * 再現率) \/ (適合率 + 再現率): F1 スコアは、適合率と再現率の調和平均です。\nユーザーは、一部の属性について文字列比較を行う際に、数値以外の値のマッチングを部分的に柔軟にしたい場合があります。たとえば、収益源に関する質問を考えてみましょう。ここで、参考の回答の 1 つが複数形の「データ センター」(“Data Centers”) で、モデルが単数形の「データ センター」(“Data Center”)を出力します。完全一致評価では、これは「不一致」として扱われます。このような場合に、より堅牢な評価を実現するには、Python のデフォルトの\ndifflib\nでファジー マッチング (fuzzy matching) を使用します。\nimport difflib\n \n \ndef get_ratio_match(gt_string, pred_string):\n if len(gt_string) < len(pred_string):\n min_len = len(gt_string)\n else:\n min_len = len(pred_string)\n matcher = difflib.SequenceMatcher(None, gt_string, pred_string, autojunk=False)\n _, _, longest_match = matcher.find_longest_match(0, min_len, 0, min_len)\n # Return the ratio of match with ground truth\n return longest_match \/ min_len\n評価では、類似度が 90% を超える文字列属性は一致していると見なします。\n表 1 は、手動で注釈を付けたデータに対する、最もよく使用される 2 つのオープンソース モデル ファミリ (\nMistral AI Mixtral モデル\nと\nMeta Llama 3 モデル\n) の結果を示しています。どちらのモデル ファミリでも、パラメーターの数を減らすとパフォーマンスが著しく低下��ます。これらの NIM を体験するには、\nNVIDIA API カタログ\nにアクセスしてください。\nMethod\nF1\nPrecision\nRecall\nLlama 3 70B\n84.4%\n91.3%\n78.5%\nLlama 3 8B\n75.8%\n85.2%\n68.2%\nMixtral 8x22B\n84.4%\n91.9%\n78.0%\nMixtral 8x7B\n62.2%\n80.2%\n50.7%\n表1. 収益報告電話会議の記録からのJSON構造化情報抽出と質問応答におけるLlamaおよびMixtralモデルのパフォーマンス\nMixtral-8x22B は、Llama 3 70B とほぼ同等のパフォーマンスを持っているようです。ただし、どちらのモデル ファミリでも、パラメーターの数を減らすとパフォーマンスが大幅に低下します。低下は Recall で最も顕著です。これは、ハードウェア要件の増加を犠牲にして精度を向上させることを選択するというトレードオフを頻繁に示しています。\nほとんどの場合、ドメイン固有のデータ (この場合は、収益通話のトランスクリプト) を使用して、Embedder、Reranker、または LLM のいずれかを微調整することで、パラメーターの数を増やすことなくモデルの精度を向上させることができます。\nEmbedder は最も小さいため、微調整が最も迅速かつコスト効率に優れています。詳細な手順については、\nNVIDIA NeMo のドキュメント\nを参照してください。さらに、\nNVIDIA NeMo\nは、LLM の有効なバージョンを微調整する効率を簡素化し、強化します。\nユーザー向け重要な意味合い\nこのデモは、収益報告の記録から洞察を抽出するように設計されています。NIM などの高度な AI テクノロジを活用することで、収益報告の記録から情報を迅速かつ正確に取得できるようになりました。AI 製品は、文書化とデータ分析の最も集中的なプロセス中に、複数のカテゴリの金融研究者、アナリスト、アドバイザー、ファンダメンタル ポートフォリオ マネージャーを支援し、金融専門家が戦略的な意思決定や顧客対応に多くの時間を費やせるようにします。\nたとえば、資産管理セクターでは、ポートフォリオ マネージャーはアシスタントを使用して、膨大な数の収益報告から洞察をすばやく統合し、投資戦略と結果を改善できます。保険業界では、AI アシスタントが企業レポートから財務の健全性とリスク要因を分析し、引受とリスク評価のプロセスを強化できます。ファンダメンタル トレーディングと小売取引では、アシスタントが体系的な情報抽出を支援して市場のトレンドと感情の変化を特定し、将来の取引でより詳細な情報を使用できるようにします。\n銀行でも、収益報告を分析することで、潜在的なローン受領者の財務安定性を評価するために使用できます。最終的に、このテクノロジーは効率、精度、データに基づく意思決定能力を高め、ユーザーにそれぞれの市場での競争上の優位性をもたらします。\nNVIDIA API カタログ\nにアクセスして、利用可能なすべての NIM を確認し、\nLangChain の便利な統合\nを試して、自分のデータに最適なものを味見してください。\n関連情報\nGTC セッション:\nSQL からチャットへ: NVIDIA でエンタープライズ データ分析を変革する方法\nNGC コンテナー:\nDiffDock\nNGC コンテナー:\nNMT Megatron Riva 1b\nウェビナー:\n資本市場における次世代分析: 取引実行とリスク管理\nウェビナー:\n金融サービス向けの大規模な AI モデル推論の加速"} +{"en_url":"https:\/\/developer.nvidia.com\/blog\/tune-and-deploy-lora-llms-with-nvidia-tensorrt-llm\/","en_title":"Tune and Deploy LoRA LLMs with NVIDIA TensorRT-LLM","en_content":"Large language models\n(LLMs) have revolutionized natural language processing (NLP) with their ability to learn from massive amounts of text and generate fluent and coherent texts for various tasks and domains. However,\ncustomizing LLMs\nis a challenging task, often requiring a full\ntraining process\nthat is time-consuming and computationally expensive. Moreover, training LLMs requires a diverse and representative dataset, which can be difficult to obtain and curate.\nHow can enterprises leverage the power of LLMs without paying the cost of full training? One promising solution is Low-Rank Adaptation (LoRA), a fine-tuning method that can significantly reduce the number of trainable parameters, the memory requirement, and the training time, while achieving comparable or even better performance than fine-tuning on various NLP tasks and domains.\nThis post explains the intuition and the implementation of LoRA, and shows some of its applications and benefits. It also compares LoRA with supervised fine-tuning and prompt engineering, and discusses their advantages and limitations. It outlines practical guidelines for both training and inference of LoRA-tuned models. Finally, it demonstrates how to use\nNVIDIA TensorRT-LLM\nto optimize deployment of LoRA models on NVIDIA GPUs.\nTutorial prerequisites\nTo make best use of this tutorial, you will need basic knowledge of LLM training and inference pipelines, as well as:\nBasic knowledge of linear algebra\nHugging Face\nregistered user access and general familiarity with the Transformers library\nNVIDIA\/TensorRT-LLM optimization library\nNVIDIA Triton Inference Server\nwith\nTensorRT-LLM backend\nWhat is LoRA?\nLoRA is a fine-tuning method that introduces low-rank matrices into each layer of the LLM architecture, and only trains these matrices while keeping the original LLM weights frozen. It is among the LLM customization tools supported in\nNVIDIA NeMo\n(Figure 1).\nFigure 1. LoRA is among the LLM customization tools and techniques supported in NVIDIA NeMo\nLLMs are powerful, but often require customization, especially when used for enterprise or domain-specific use cases. There are many tuning options, ranging from simple prompt engineering to supervised fine-tuning (SFT). The choice of tuning option is typically based on the size of the dataset required (minimum for prompt engineering, maximum for SFT) and compute availability.\nLoRA tuning is a type of tuning family called Parameter Efficient Fine-Tuning (PEFT). These techniques are a middle-of-the-road approach. They require more training data and compute compared to prompt engineering, but also yield much higher accuracy. The common theme is that they introduce a small number of parameters or layers while keeping the original LLM unchanged.\nPEFT has been proven to achieve comparable accuracy to SFT while using less data and less computational resources. Compared to other tuning techniques, LoRA has several advantages. It reduces the computational and memory cost, as it only adds a few new parameters, but does not add any layers. It enables multi-task learning, allowing a single-base LLM to be used for different tasks by deploying the relevant fine-tuned LoRA variant on demand, only loading its low-rank matrices when needed.\nFinally, it avoids catastrophic forgetting, the natural tendency of LLMs to abruptly forget previously learned information upon learning new data. Quantitatively, LoRA performs better than models using alternative tuning techniques such as prompt tuning and adapters, as shown in\nLoRA: Low-Rank Adaptation of Large Language Models\n.\nThe math behind LoRA\nThe math behind LoRA is based on the idea of low-rank decomposition, which is a way of approximating a matrix by a product of two smaller matrices with lower ranks. A rank of a matrix is the number of linearly independent rows or columns in the matrix. A low-rank matrix has fewer degrees of freedom and can be represented more compactly than a full-rank matrix.\nLoRA applies low-rank decomposition to the weight matrices of the LLM, which are usually very large and dense. For example, if the LLM has a hidden size of 1,024 and a vocabulary size of 50,000, then the output weight matrix\nwould have 1024 x 50,000 = 51,200,000 parameters.\nLoRA decomposes this matrix\ninto two smaller matrices, matrix\nwith the shape of 1024 x\nand matrix\nwith the shape of\nx 50,000, where\nis a hyperparameter that controls the rank of the decomposition. The product of these two matrices would have the same shape as the original matrix, but only 1024 x\n+\nx 50,000 = 51,200,000 – 50,000 x (1024 –\n) parameters.\nThe hyperparameter\nis critical to set correctly. Choosing a smaller\ncan save a lot of parameters and memory and achieve faster training. However, a smaller\ncan potentially decrease task-specific information captured in the low-rank matrices. A larger\ncan lead to overfitting. Hence, it’s important to experiment in order to achieve the ideal accuracy-performance trade-off for your specific task and data.\nLoRA inserts these low-rank matrices into each layer of the LLM, and adds them to the original weight matrices. The original weight matrices are initialized with the pretrained LLM weights and are not updated during training. The low-rank matrices are randomly initialized and are the only parameters that are updated during training. LoRA also applies layer normalization to the sum of the original and low-rank matrices to stabilize the training.\nFigure 2. The decomposition of the LLM matrix W into two low-ranking matrices A and B\nMulti-LoRA deployment\nOne challenge in deploying LLMs is how to efficiently serve hundreds or thousands of tuned models. For example, a single base LLM, such as Llama 2, may have many LoRA-tuned variants per language or locale. A standard system would require loading all the models independently, taking up large amounts of memory capacity. Take advantage of LoRA’s design, capturing all the information in smaller low-rank matrices per model, by loading a single base model together with the low-rank matrices\nA\nand\nB\nfor each respective LoRA tuned variant. In this manner, it’s possible to store thousands of LLMs and run them dynamically and efficiently within a minimal GPU memory footprint.\nLoRA tuning\nLoRA tuning requires preparing a training dataset in a specific format, typically using prompt templates. You should determine and adhere to a pattern when forming the prompt, which will naturally vary across different use cases. An example for question and answer is shown below.\n{\n \"taskname\": \"squad\",\n \"prompt_template\": \"<|VIRTUAL_PROMPT_0|> Context: {context}\\n\\nQuestion: {question}\\n\\nAnswer:{answer}\",\n \"total_virtual_tokens\": 10,\n \"virtual_token_splits\": [10],\n \"truncate_field\": \"context\",\n \"answer_only_loss\": True,\n \"answer_field\": \"answer\",\n}\nThe prompt contains all the 10 virtual tokens at the beginning, followed by the context, the question, and finally the answer. The corresponding fields in the training data JSON object will be mapped to this prompt template to form complete training examples.\nThere are several available platforms for customizing LLMs. You can use\nNVIDIA NeMo\n, or a tool such as\nHugging Face PEFT\n. For an example of how to tune LoRA on the PubMed dataset using NeMo, see\nNeMo Framework PEFT with Llama 2\n.\nNote that this post uses ready-tuned LLMs from Hugging Face, so there is no need to tune.\nLoRA inference\nTo optimize a LoRA-tuned LLM with TensorRT-LLM, you must understand its architecture and identify which common base architecture it most closely resembles. This tutorial uses Llama 2 13B and Llama 2 7B as the base models, as well as several LoRA-tuned variants available on Hugging Face.\nThe first step is to use the converter and build scripts in this directory to compile all the models and prepare them for hardware acceleration. I’ll then show examples of deployment using both the command line and Triton Inference Server.\nNote that the tokenizer is not handled directly by TensorRT-LLM. But it is necessary to be able to classify it within a defined tokenizer family for runtime and for setting preprocessing and postprocessing steps in Triton.\nSet up and build TensorRT-LLM\nStart by cloning and building the\nNVIDIA\/TensorRT-LLM\nlibrary. The easiest way to build TensorRT-LLM and retrieve all its dependencies is to use the included Dockerfile. These commands pull a base container and install all the dependencies needed for TensorRT-LLM inside the container. It then builds and installs TensorRT-LLM itself in the container.\ngit lfs install\ngit clone -b v0.7.1 https:\/\/github.com\/NVIDIA\/TensorRT-LLM.git\ncd TensorRT-LLM\ngit submodule update --init --recursive\nmake -C docker release_build\nRetrieve model weights\nDownload the base model and LoRA model from Hugging Face:\ngit-lfs clone https:\/\/huggingface.co\/meta-llama\/Llama-2-13b-hf\ngit-lfs clone https:\/\/huggingface.co\/hfl\/chinese-llama-2-lora-13b\nCompile the model\nBuild the engine, setting\n--use_lora_plugin\nand\n--hf_lora_dir\n. If LoRA has a separate\nlm_head\nand embedding, these will replace the\nlm_head\nand embedding of the base model.\npython convert_checkpoint.py --model_dir \/tmp\/llama-v2-13b-hf \\\n --output_dir .\/tllm_checkpoint_2gpu_lora \\\n --dtype float16 \\\n --tp_size 2 \\\n --hf_lora_dir \/tmp\/chinese-llama-2-lora-13b\n \ntrtllm-build --checkpoint_dir .\/tllm_checkpoint_2gpu_lora \\\n --output_dir \/tmp\/new_lora_13b\/trt_engines\/fp16\/2-gpu\/ \\\n --gpt_attention_plugin float16 \\\n --gemm_plugin float16 \\\n --lora_plugin float16 \\\n --max_batch_size 1 \\\n --max_input_len 512 \\\n --max_output_len 50 \\\n --use_fused_mlp\nRun the model\nTo run the model during inference, set up the\nlora_dir\ncommand line argument. Remember to use the LoRA tokenizer, as the LoRA-tuned model has a larger vocabulary size.\nmpirun -n 2 python ..\/run.py --engine_dir \"\/tmp\/new_lora_13b\/trt_engines\/fp16\/2-gpu\/\" \\\n --max_output_len 50 \\\n --tokenizer_dir \"chinese-llama-2-lora-13b\/\" \\\n --input_text \"今天天气很好,我到公园的时后,\" \\\n --lora_dir \"chinese-llama-2-lora-13b\/\" \\\n --lora_task_uids 0 \\\n --no_add_special_tokens \\\n --use_py_session\n\n Input: \"今天天气很好,我到公园的时后,\"\nOutput: \"发现公园里人很多,有的在打羽毛球,有的在打乒乓球,有的在跳绳,还有的在跑步。我和妈妈来到一个空地上,我和妈妈一起跳绳,我跳了1\"\nYou can run ablation tests to see the contribution of the LoRA-tuned model first-hand. To easily compare results with and without LoRa, simply set the UID to -1 using\n--lora_task_uids -1\n. In this case, the model will ignore the LoRA module and the results will be based on the base model alone.\nmpirun -n 2 python ..\/run.py --engine_dir \"\/tmp\/new_lora_13b\/trt_engines\/fp16\/2-gpu\/\" \\\n --max_output_len 50 \\\n --tokenizer_dir \"chinese-llama-2-lora-13b\/\" \\\n --input_text \"今天天气很好,我到公园的时后,\" \\\n --lora_dir \"chinese-llama-2-lora-13b\/\" \\\n --lora_task_uids -1 \\\n --no_add_special_tokens \\\n --use_py_session\n\n Input: \"今天天气很好,我到公园的时后,\"\nOutput: \"我看见一个人坐在那边边看书书,我看起来还挺像你,可是我走过过去问了一下他说你是你吗,他说没有,然后我就说你看我看看你像你,他说说你看我像你,我说你是你,他说你是你,\"\nRun the base model with multiple LoRA-tuned models\nTensorRT-LLM also supports running a single base model with multiple LoRA-tuned modules at the same time. Here, we use two LoRA checkpoints as examples. As the rank\nof the LoRA modules of both checkpoints is 8, you can set\n--max_lora_rank\nto 8 in order to reduce the memory requirement for the LoRA plugin.\nThis example uses a LoRA checkpoint fine-tuned on the Chinese dataset\nchinese-llama-lora-7b\nand a LoRA checkpoint fine-tuned on the Japanese dataset\nJapanese-Alpaca-LoRA-7b-v0\n. For TensorRT-LLM to load several checkpoints, pass in the directories of all the LoRA checkpoints through\n--lora_dir\n\"chinese-llama-lora-7b\/\"\n\"Japanese-Alpaca-LoRA-7b-v0\/\"\n. TensorRT-LLM will assign\nlora_task_uids\nto these checkpoints.\nlora_task_uids -1\nis a predefined value, which corresponds to the base model. For example, passing\nlora_task_uids 0 1\nwill use the first LoRA checkpoint on the first sentence and use the second LoRA checkpoint on the second sentence.\nTo verify correctness, pass the same Chinese input 美国的首都在哪里? \\n答案: three times, as well as the same Japanese input アメリカ合衆国の首都はどこですか? \\n答え: three times. (In English, both inputs mean, “Where is the capital of America? \\nAnswer”). Then run on the base model,\nchinese-llama-lora-7b\nand\nJapanese-Alpaca-LoRA-7b-v0\n, respectively:\ngit-lfs clone https:\/\/huggingface.co\/hfl\/chinese-llama-lora-7b\ngit-lfs clone https:\/\/huggingface.co\/kunishou\/Japanese-Alpaca-LoRA-7b-v0\nBASE_LLAMA_MODEL=llama-7b-hf\/\n\npython convert_checkpoint.py --model_dir ${BASE_LLAMA_MODEL} \\\n --output_dir .\/tllm_checkpoint_1gpu_lora_rank \\\n --dtype float16 \\\n --hf_lora_dir \/tmp\/Japanese-Alpaca-LoRA-7b-v0 \\\n --max_lora_rank 8 \\\n --lora_target_modules \"attn_q\" \"attn_k\" \"attn_v\"\n\ntrtllm-build --checkpoint_dir .\/tllm_checkpoint_1gpu_lora_rank \\\n --output_dir \/tmp\/llama_7b_with_lora_qkv\/trt_engines\/fp16\/1-gpu\/ \\\n --gpt_attention_plugin float16 \\\n --gemm_plugin float16 \\\n --lora_plugin float16 \\\n --max_batch_size 1 \\\n --max_input_len 512 \\\n --max_output_len 50\n\npython ..\/run.py --engine_dir \"\/tmp\/llama_7b_with_lora_qkv\/trt_engines\/fp16\/1-gpu\/\" \\\n --max_output_len 10 \\\n --tokenizer_dir ${BASE_LLAMA_MODEL} \\\n --input_text \"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \\\n --lora_dir \"lchinese-llama-lora-7b\/\" \"Japanese-Alpaca-LoRA-7b-v0\/\" \\\n --lora_task_uids -1 0 1 -1 0 1 \\\n --use_py_session --top_p 0.5 --top_k 0\nThe results are shown below:\nInput [Text 0]: \" 美国的首都在哪里? \\n答案:\"\nOutput [Text 0 Beam 0]: \"Washington, D.C.\nWhat is the\"\n\nInput [Text 1]: \" 美国的首都在哪里? \\n答案:\"\nOutput [Text 1 Beam 0]: \"华盛顿。\n\"\n\nInput [Text 2]: \" 美国的首都在哪里? \\n答案:\"\nOutput [Text 2 Beam 0]: \"Washington D.C.'''''\"\n\nInput [Text 3]: \" アメリカ合衆国の首都はどこですか? \\n答え:\"\nOutput [Text 3 Beam 0]: \"Washington, D.C.\nWhich of\"\n\nInput [Text 4]: \" アメリカ合衆国の首都はどこですか? \\n答え:\"\nOutput [Text 4 Beam 0]: \"华盛顿。\n\"\n\nInput [Text 5]: \" アメリカ合衆国の首都はどこですか? \\n答え:\"\nOutput [Text 5 Beam 0]: \"ワシントン D.C.\"\nNotice that\nchinese-llama-lora-7b\nproduces correct answers on the first sentence and the fifth sentence (in Chinese).\nJapanese-Alpaca-LoRA-7b-v0\nproduces correct answers on the sixth sentence (in Japanese).\nImportant note:\nIf one of the LoRA modules contains a fine-tuned embedding table or logit GEMM, users must guarantee that all ‌instances of the model can use the same fine-tuned embedding table or logit GEMM.\nDeploying LoRA tuned models with Triton and inflight batching\nThis section shows how to deploy LoRA-tuned models using inflight batching with Triton Inference server. For specific instructions on setting up and launching the Triton Inference Server, see\nDeploy an AI Coding Assistant with NVIDIA TensorRT-LLM and NVIDIA Triton\n.\nAs before, first compile a model with LoRA enabled, this time with the base model Llama 2 7B.\nBASE_MODEL=llama-7b-hf\n\npython3 tensorrt_llm\/examples\/llama\/build.py --model_dir ${BASE_MODEL} \\\n --dtype float16 \\\n --remove_input_padding \\\n --use_gpt_attention_plugin float16 \\\n --enable_context_fmha \\\n --use_gemm_plugin float16 \\\n --output_dir \"\/tmp\/llama_7b_with_lora_qkv\/trt_engines\/fp16\/1-gpu\/\" \\\n --max_batch_size 128 \\\n --max_input_len 512 \\\n --max_output_len 50 \\\n --use_lora_plugin float16 \\\n --lora_target_modules \"attn_q\" \"attn_k\" \"attn_v\" \\\n --use_inflight_batching \\\n\t\t --paged_kv_cache \\\n --max_lora_rank 8 \\\n --world_size 1 --tp_size 1\nNext, generate LoRA tensors that will be passed in with each request to Triton.\ngit-lfs clone https:\/\/huggingface.co\/hfl\/chinese-llama-lora-7b\ngit-lfs clone https:\/\/huggingface.co\/kunishou\/Japanese-Alpaca-LoRA-7b-v0\n\npython3 tensorrt_llm\/examples\/hf_lora_convert.py -i Japanese-Alpaca-LoRA-7b-v0 -o Japanese-Alpaca-LoRA-7b-v0-weights --storage-type float16\npython3 tensorrt_llm\/examples\/hf_lora_convert.py -i chinese-llama-lora-7b -o chinese-llama-lora-7b-weights --storage-type float16\nThen create a Triton model repository and launch the Triton server as previously described.\nFinally, run the multi-LoRA example by issuing multiple concurrent requests from the client. The inflight batcher will execute mixed batches with multiple LoRAs in the same batch.\nINPUT_TEXT=(\"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\")\nLORA_PATHS=(\"\" \"chinese-llama-lora-7b-weights\" \"Japanese-Alpaca-LoRA-7b-v0-weights\" \"\" \"chinese-llama-lora-7b-weights\" \"Japanese-Alpaca-LoRA-7b-v0-weights\")\n\nfor index in ${!INPUT_TEXT[@]}; do\n text=${INPUT_TEXT[$index]}\n lora_path=${LORA_PATHS[$index]}\n lora_arg=\"\"\n if [ \"${lora_path}\" != \"\" ]; then\n lora_arg=\"--lora-path ${lora_path}\"\n fi\n\n python3 inflight_batcher_llm\/client\/inflight_batcher_llm_client.py \\\n --top-k 0 \\\n --top-p 0.5 \\\n --request-output-len 10 \\\n --text \"${text}\" \\\n --tokenizer-dir \/home\/scratch.trt_llm_data\/llm-models\/llama-models\/llama-7b-hf \\\n ${lora_arg} &\ndone\n\nwait\nExample output is shown below:\nInput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901]\nInput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901]\nInput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901]\nInput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901]\nInput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901]\nInput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901]\nGot completed request\nInput: アメリカ合衆国の首都はどこですか? \\n答え:\nOutput beam 0: ワシントン D.C.\nOutput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901, 29871, 31028, 30373, 30203, 30279, 30203, 360, 29889, 29907, 29889]\nGot completed request\nInput: 美国的首都在哪里? \\n答案:\nOutput beam 0: Washington, D.C.\nWhat is the\nOutput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901, 7660, 29892, 360, 29889, 29907, 29889, 13, 5618, 338, 278]\nGot completed request\nInput: 美国的首都在哪里? \\n答案:\nOutput beam 0: Washington D.C.\nWashington D.\nOutput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901, 7660, 360, 29889, 29907, 29889, 13, 29956, 7321, 360, 29889]\nGot completed request\nInput: アメリカ合衆国の首都はどこですか? \\n答え:\nOutput beam 0: Washington, D.C.\nWhich of\nOutput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901, 7660, 29892, 360, 29889, 29907, 29889, 13, 8809, 436, 310]\nGot completed request\nInput: アメリカ合衆国の首都はどこですか? \\n答え:\nOutput beam 0: Washington D.C.\n1. ア\nOutput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901, 7660, 360, 29889, 29907, 29889, 13, 29896, 29889, 29871, 30310]\nGot completed request\nInput: 美国的首都在哪里? \\n答案:\nOutput beam 0: 华盛顿\nW\nOutput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 1\nConclusion\nWith baseline support for many popular LLM architectures, TensorRT-LLM makes it easy to deploy, experiment, and optimize with a variety of code LLMs. Together, NVIDIA TensorRT-LLM and NVIDIA Triton Inference Server provide an indispensable toolkit for optimizing, deploying, and running LLMs efficiently. With support for LoRA-tuned models, TensorRT-LLM enables efficient deployment of customized LLMs, significantly reducing memory and computational cost.\nTo get started, download and set up the\nNVIDIA\/TensorRT-LLM\nopen-source library, and experiment with the different\nexample LLMs\n. You can tune your own LLM using\nNVIDIA NeMo\n—see\nNeMo Framework PEFT with Llama 2\nfor an example. As an alternative, you can also deploy using the\nNeMo Framework Inference Container\n.","jp_url":"https:\/\/developer.nvidia.com\/ja-jp\/blog\/tune-and-deploy-lora-llms-with-nvidia-tensorrt-llm\/","jp_title":"NVIDIA TensorRT-LLM による、LoRA LLM のチューニングとデプロイ","jp_content":"Reading Time:\n7\nminutes\n大規模言語モデル\n(LLM) は、膨大なテキストから学習し、さまざまなタスクや領域に合わせ、流暢で一貫したテキストを生成できることから、自然言語処理 (NLP) に革命を起こしました。ただし、\nLLM のカスタマイズ\nは困難な作業であり、多くの場合、完全な\nトレーニング プロセス\nを必要とし、時間と計算コストがかかります。さらに、LLM のトレーニングには多様かつ代表的なデータセットが必要であり、取得とキュレーションが困難な場合があります。\n企業は、どうすれば完全なトレーニングにかかる費用を支払うことなく、LLM のパワーを活用できるでしょうか? 有望なソリューションの 1 つは Low-Rank Adaptation (LoRA) です。これは、トレーニング可能なパラメーターの数、メモリ要件、トレーニング時間を大幅に減らし、かつ、NLP のさまざまな作業と分野でファインチューニングする場合に匹敵するか、それを上回ることさえあるパフォーマンスを達成できるファインチューニングの手法です。\nこの記事では、LoRA の洞察力と実装について説明し、その応用と利点の一部をご紹介します。LoRA を教師ありファインチューニングやプロンプト エンジニアリングと比較し、その利点と限界についても説明します。LoRA でチューニングしたモデルのトレーニングと推論の両方のための実用的なガイドラインを概説し、最後に、\nNVIDIA TensorRT-LLM\nを使用して NVIDIA GPU での LoRA モデルのデプロイを最適化する方法を示します。\nチュートリアルの前提条件\nこのチュートリアルを最大限に活用するには、LLM トレーニングおよび推論パイプラインの基本的な知識と以下の知識が必要です。\n線形代数の基礎知識\nHugging Face\nの登録ユーザー アクセスと、Transformers ライブラリに関する一般的な知識\nNVIDIA\/TensorRT-LLM 最適化ライブラリ\nTensorRT-LLM バックエンド\nを備えた\nNVIDIA Triton Inference Server\nLoRA とは?\nLoRA は、ファインチューニングの手法であり、LLM アーキテクチャの各層に低ランク行列を導入し、元の LLM の重みはそのままでその行列のみをトレーニングします。\nNVIDIA NeMo\nでサポートされている LLM カスタマイゼーション ツールの 1 つです (図 1)。\n図 1. LoRA は、NVIDIA NeMo でサポートされている LLM カスタマイズ ツールおよび手法の 1 つ\nLLM はパワフルですが、企業やドメイン固有の用途で使用する場合は特に、カスタマイズが必要になることが頻繁にあります。簡単なプロンプト エンジニアリングから教師ありファインチューニング (SFT) まで、さまざまなチューニング オプションがあります。チューニング オプションの選択は通常、必要とされるデータセットの規模 (プロンプト エンジニアリングで最小、SFT で最大) と、利用できる計算処理リソースに基づきます。\nLoRA チューニングは Parameter Efficient Fine-Tuning (PEFT) と呼ばれているチューニング群の一種です。PEFT は中庸的な手法であり、プロンプト エンジニアリングよりも多くのトレーニング データと計算を必要としますが、精度はずっと高くなります。元の LLM を変えずに、少数のパラメーターまたは層を導入するという点が PEFT の共通項目です。\nPEFT は、使用するデータと計算リソースが SFT より少ないながら、SFT に匹敵する精度を達成することが証明されています。他のチューニング手法と比較すると、LoRA にはいくつかの利点があります。いくつかの新しいパラメーターを追加するだけで、層は追加しないため、計算コストとメモリ コストを削減できます。これによりマルチタスク学習が可能になり、関連するファインチューニングされた LoRA バリアントを必要に応じてデプロイし、必要なときだけその低ランク行列を読み込むことで、さまざまなタスクで単一ベースの LLM を利用できます。\n最後になりますが、新しいデータを学習したとき、前に学習した情報を突然忘れるという壊滅的な忘却 (LLM にとっては自然な傾向) が回避されます。「\nLoRA: Low-Rank Adaptation of Large Language Models\n」に示すように、LoRA は定量的に、プロンプト チューニングやアダプターなどの代わりとなるチューニング方法を使用するモデルよりもパフォーマンスが優れています。\nLoRA の背後にある数学\nLoRA の背後にある数学は低ランク分解という考えに基づいています。これはランクの低い 2 つの小さな行列の積で行列を近似するという手法です。行列のランクは行列の線形独立な行または列の数になります。低ランクの行列は自由度が低く、フルランクの行列よりコンパクトに表現できます。\nLoRA では、通常は非常に大きく密な LLM の重み行列に低ランク分解を適用します。たとえば、LLM の隠れ層のサイズが 1,024 で、語彙サイズが 50,000 のとき、出力される重み行列\nのパラメーターは 1024 x 50,000 = 51,200,000 個になります。\nLoRA ではこの行列\nを 2 つの小さな行列に分解します。1024 x\n行列\nと\nx 50,000 行列\nです。\nは分解のランクを制御するハイパーパラメーターです。この 2 つの行列の積の形は元の行列と同じになりますが、パラメーターは 1024 x\n+\nx 50,000 = 51,200,000 – 50,000 x (1024 –\n) 個だけになります。\nハイパーパラメーター\nは正しく設定することが重要です。小さな\nを選択することでたくさんのパラメーターとメモリが節約され、トレーニングが速くなります。ただし、\nが小さいと、低ランク行列でキャプチャされるタスク固有情報が少なくなる可能性があります。\nが大きいと、過剰適合になることがあります。したがって、特定のタスクとデータに対して精度とパフォーマンスの理想的なトレードオフを達成するためには、実験を行うことが重要です。\nLoRA では、低ランク行列を LLM の各層に挿入し、元の重み行列に追加します。元の重み行列は学習済み LLM 重みで初期化され、トレーニング中に更新されることはありません。低ランク行列はランダムに初期化され、トレーニング中に更新される唯一のパラメーターとなります。LoRA ではまた、元の行列と低ランク行列の合計に層の正規化を適用し、トレーニングを安定させます。\n図 2. LLM 行列 W を 2 つの低ランク行列 A と B に分解\nマルチ LoRA デプロイ\nLLM のデプロイにおける課題の 1 つは、数百または数千のチューニングされたモデルをいかにして効率的に与えるかです。たとえば、Llama 2 などの単一ベースの LLM には、言語またはロケールごとに多くの LoRA でチューニングしたバリアントが含まれることがあります。標準的なシステムでは、すべてのモデルを非依存で読み込むことが必要になり、メモリ容量の大部分を占めることがあります。LoRA の設計を活用し、LoRA でチューニングした各バリアントに対して低ランク行列\nA\nと\nB\nと共に単一基本モデルを読み込むことで、モデルごとに小さな低ランク行列ですべての情報をキャプチャします。このようにし���、数千の LLM を保存し、最小の GPU メモリ フットプリントで動的かつ効率的に実行できます。\nLoRA チューニング\nLoRA チューニングでは、通常はプロンプト テンプレートを使用し、トレーニング データセットを特定の形式で準備する必要があります。プロンプトを形成するとき、パターンを決定し、それに従う必要があります。これは当然、さまざまな用途によって異なります。質問と回答の例を以下に示します。\n{\n \"taskname\": \"squad\",\n \"prompt_template\": \"<|VIRTUAL_PROMPT_0|> Context: {context}\\n\\nQuestion: {question}\\n\\nAnswer:{answer}\",\n \"total_virtual_tokens\": 10,\n \"virtual_token_splits\": [10],\n \"truncate_field\": \"context\",\n \"answer_only_loss\": True,\n \"answer_field\": \"answer\",\n}\nこのプロンプトには、最初に 10 個の仮想トークン全部が含まれ、文脈と質問がそれに続き、最後に回答が加わります。トレーニング データ JSON オブジェクトの対応するフィールドがこのプロンプト テンプレートにマッピングされ、完全なトレーニング例が形成されます。\nLLM をカスタマイズするためのプラットフォームがいくつかあります。\nNVIDIA NeMo\nを使用するか、\nHugging Face PEFT\nなどのツールを使用することができます。NeMo を使用し、PubMed データセットで LoRA をチューニングする方法の例が必要であれば、「\nNeMo Framework PEFT with Llama2 and Mixtral-8x7B\n」をご覧ください。\nこの記事では、Hugging Face のチューニング済み LLM を使用しているため、チューニングする必要がないことにご留意ください。\nLoRA 推論\nLoRA でチューニングした LLM を TensorRT-LLM で最適化するには、そのアーキテクチャを理解し、それが最も似ている共通の基本のアーキテクチャを特定する必要があります。このチュートリアルでは、Llama 2 13B と Llama 2 7B を基本モデルとして使用します。また、Hugging Face で利用できるいくつかの LoRA でチューニングしたバリアントも使用します。\n最初の手順では、コンバーターを使用し、このディレクトリでスクリプトを構築し、すべてのモデルをコンパイルし、ハードウェア アクセラレーションの準備をします。次に、コマンド ラインと Triton Inference Server の両方を使用したデプロイ例をご紹介します。\nトークナイザーが TensorRT-LLM によって直接処理されることはないことにご注意ください。ただ、実行時のためと、Triton で前処理と後処理のステップを設定するためには、定義済みのトークナイザー ファミリ内でそれを分類できる必要があります。\nTensorRT-LLM を設定してビルドする\nまず、\nNVIDIA\/TensorRT-LLM\nライブラリをクローンし、ビルドします。TensorRT-LLM をビルドし、その依存関係をすべて取得する最も簡単な方法は、付属の Dockerfile を使用することです。以下のコマンドでは、基本コンテナーが pull され、そのコンテナーの中に TensorRT-LLM に必要なすべての依存関係がインストールされます。次に、TensorRT-LLM 自体がビルドされ、コンテナーにインストールされます。\ngit lfs install\ngit clone https:\/\/github.com\/NVIDIA\/TensorRT-LLM.git\ncd TensorRT-LLM\ngit submodule update --init --recursive\nmake -C docker release_build\nモデルの重みを取得する\n基本モデルと LoRA モデルを Hugging Face からダウンロードします。\ngit-lfs clone\nhttps:\/\/huggingface.co\/meta-llama\/Llama-2-13b-hf\ngit-lfs clone\nhttps:\/\/huggingface.co\/hfl\/chinese-llama-2-lora-13b\nモデルをコンパイルする\nエンジンを構築し\n、\n--use_lora_plugin\nと\n--hf_lora_dir\nを設定します。LoRA に別の\nlm_head\nと埋め込みがある場合、それは基本モデルの\nlm_head\nと埋め込みを置き換えます。\npython convert_checkpoint.py --model_dir \/tmp\/llama-v2-13b-hf \\\n --output_dir .\/tllm_checkpoint_2gpu_lora \\\n --dtype float16 \\\n --tp_size 2 \\\n --hf_lora_dir \/tmp\/chinese-llama-2-lora-13b\n \ntrtllm-build --checkpoint_dir .\/tllm_checkpoint_2gpu_lora \\\n --output_dir \/tmp\/new_lora_13b\/trt_engines\/fp16\/2-gpu\/ \\\n --gpt_attention_plugin float16 \\\n --gemm_plugin float16 \\\n --lora_plugin float16 \\\n --max_batch_size 1 \\\n --max_input_len 512 \\\n --max_output_len 50 \\\n --use_fused_mlp\nモデルを実行する\n推論中にモデルを実行するには、\nlora_dir\nコマンド ライ���引数を設定します。LoRA でチューニングしたモデルでは語彙サイズが大きいため、LoRA トークナイザーを必ず使用してください。\nmpirun -n 2 python ..\/run.py --engine_dir \"\/tmp\/new_lora_13b\/trt_engines\/fp16\/2-gpu\/\" \\\n --max_output_len 50 \\\n --tokenizer_dir \"chinese-llama-2-lora-13b\/\" \\\n --input_text \"今天天气很好,我到公园的时后,\" \\\n --lora_dir \"chinese-llama-2-lora-13b\/\" \\\n --lora_task_uids 0 \\\n --no_add_special_tokens \\\n --use_py_session\n \n Input: \"今天天气很好,我到公园的时后,\"\nOutput: \"发现公园里人很多,有的在打羽毛球,有的在打乒乓球,有的在跳绳,还有的在跑步。我和妈妈来到一个空地上,我和妈妈一起跳绳,我跳了1\"\nLoRA でチューニングしたモデルの影響を、アブレーション テストを実行して直接確認することができます。LoRA がある場合とない場合の結果を簡単に比較するには、\n--lora_task_uids -1\nを使用して UID を -1 に設定します。この場合、モデルは LoRA モジュールを無視し、結果は基本モデルのみに基づきます。\nmpirun -n 2 python ..\/run.py --engine_dir \"\/tmp\/new_lora_13b\/trt_engines\/fp16\/2-gpu\/\" \\\n --max_output_len 50 \\\n --tokenizer_dir \"chinese-llama-2-lora-13b\/\" \\\n --input_text \"今天天气很好,我到公园的时后,\" \\\n --lora_dir \"chinese-llama-2-lora-13b\/\" \\\n --lora_task_uids -1 \\\n --no_add_special_tokens \\\n --use_py_session\n \n Input: \"今天天气很好,我到公园的时后,\"\nOutput: \"我看见一个人坐在那边边看书书,我看起来还挺像你,可是我走过过去问了一下他说你是你吗,他说没有,然后我就说你看我看看你像你,他说说你看我像你,我说你是你,他说你是你,\"\nLoRA でチューニングした複数のモデルと基本モデルを同時実行\nまた、TensorRT-LLM は、LoRA でチューニングした複数のモジュールと単一の基本モデルを同時に実行することもできます。ここでは、2 つの LoRA チェックポイントを例として使用します。両方のチェックポイントの LoRA モジュールのランク\nは 8 であるため、LoRA プラグインのメモリ要件を減らすために\n--max_lora_rank\nを 8 に設定できます。\nこの例では、中国語データセット chinese-llama-lora-7b でファインチューニングされた LoRA チェックポイントと、日本語データセット Japanese-Alpaca-LoRA-7b-v0 でファインチューニングされた LoRA チェックポイントを使用しています。TensorRT-LLM で複数のチェックポイントを読み込むには、\n--lora_dir \"chinese-llama-lora-7b\/\"\n\"Japanese-Alpaca-LoRA-7b-v0\/\"\n経由で全 LoRA チェックポイントのディレクトリを渡します。TensorRT-LLM は\nlora_task_uids\nをこれらのチェックポイントに割り当てます。\nlora_task_uids -1\nは基本モデルに対応する事前定義済みの値です。たとえば、\nlora_task_uids 0 1\nを渡すと、最初の文で最初の LoRA チェックポイントが使用され、2 番目の文で 2 番目の LoRA チェックポイントが使用されます。\n正しいことを確認するには、中国語の入力「美国的首都在哪里? \\n答案:」を 3 回渡し、日本語の入力「アメリカ合衆国の首都はどこですか? \\n答え:」を 3 回渡します。(英語では、いずれの入力も「Where is the capital of America? \\nAnswer」を意味します)。次に、基本モデルで chinese-llama-lora-7b と Japanese-Alpaca-LoRA-7b-v0 をそれぞれ実行します。\ngit-lfs clone\nhttps:\/\/huggingface.co\/hfl\/chinese-llama-lora-7b\ngit-lfs clone\nhttps:\/\/huggingface.co\/kunishou\/Japanese-Alpaca-LoRA-7b-v0\nBASE_LLAMA_MODEL=llama-7b-hf\/\n \npython convert_checkpoint.py --model_dir ${BASE_LLAMA_MODEL} \\\n --output_dir .\/tllm_checkpoint_1gpu_lora_rank \\\n --dtype float16 \\\n --hf_lora_dir \/tmp\/Japanese-Alpaca-LoRA-7b-v0 \\\n --max_lora_rank 8 \\\n --lora_target_modules \"attn_q\" \"attn_k\" \"attn_v\"\n \ntrtllm-build --checkpoint_dir .\/tllm_checkpoint_1gpu_lora_rank \\\n --output_dir \/tmp\/llama_7b_with_lora_qkv\/trt_engines\/fp16\/1-gpu\/ \\\n --gpt_attention_plugin float16 \\\n --gemm_plugin float16 \\\n --lora_plugin float16 \\\n --max_batch_size 1 \\\n --max_input_len 512 \\\n --max_output_len 50\n \npython ..\/run.py --engine_dir \"\/tmp\/llama_7b_with_lora_qkv\/trt_engines\/fp16\/1-gpu\/\" \\\n --max_output_len 10 \\\n --tokenizer_dir ${BASE_LLAMA_MODEL} \\\n --input_text \"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \\\n --lora_dir \"chinese-llama-lora-7b\" \"Japanese-Alpaca-LoRA-7b-v0\/\" \\\n --lora_task_uids -1 0 1 -1 0 1 \\\n --use_py_session --top_p 0.5 --top_k 0\n結果を以下に示します。\nInput [Text 0]: \" 美国的首都在哪里? \\n答案:\"\nOutput [Text 0 Beam 0]: \"Washington, D.C.\nWhat is the\"\n \nInput [Text 1]: \" 美国的首都在哪里? \\n答案:\"\nOutput [Text 1 Beam 0]: \"华盛顿。\n\"\n \nInput [Text 2]: \" 美国的首都在哪里? \\n答案:\"\nOutput [Text 2 Beam 0]: \"Washington D.C.'''''\"\n \nInput [Text 3]: \" アメリカ合衆国の首都はどこですか? \\n答え:\"\nOutput [Text 3 Beam 0]: \"Washington, D.C.\nWhich of\"\n \nInput [Text 4]: \" アメリカ合衆国の首都はどこですか? \\n答え:\"\nOutput [Text 4 Beam 0]: \"华盛顿。\n\"\n \nInput [Text 5]: \" アメリカ合衆国の首都はどこですか? \\n答え:\"\nOutput [Text 5 Beam 0]: \"ワシントン D.C.\"\nchinese-llama-lora-7b により、最初の文と 5 番目の文で正しい答え (中国語) を出すことにご注目ください。Japanese-Alpaca-LoRA-7b-v0 により、6 番目の文で正しい答え (日本語) を生成します。\n重要な注意:\nLoRA モジュールのひとつにファインチューニングされた埋め込みテーブルまたは logit GEMM が含まれている場合、同じくファインチューニングされた埋め込みテーブルまたは logit GEMM をモデルの全インスタンスで使用できるよう、ユーザーは取り計らう必要があります。\nLoRA でチューニングしたモデルを Triton とインフライト バッチ処理でデプロイする\nこのセクションでは、LoRA でチューニングしたモデルを、Triton Inference Server でインフライト バッチ処理を使用してデプロイする方法を示します。Triton Inference Server の設定と起動に関する具体的な手順については、「\nDeploy an AI Coding Assistant with NVIDIA TensorRT-LLM and NVIDIA Triton\n」を参照してください。\n前と同じように、まず、LoRA を有効にしてモデルをコンパイルします。今回は基本モデルの Llama 2 7B でコンパイルします。\nBASE_MODEL=llama-7b-hf\n \npython3 tensorrt_llm\/examples\/llama\/build.py --model_dir ${BASE_MODEL} \\\n --dtype float16 \\\n --remove_input_padding \\\n --use_gpt_attention_plugin float16 \\\n --enable_context_fmha \\\n --use_gemm_plugin float16 \\\n --output_dir \"\/tmp\/llama_7b_with_lora_qkv\/trt_engines\/fp16\/1-gpu\/\" \\\n --max_batch_size 128 \\\n --max_input_len 512 \\\n --max_output_len 50 \\\n --use_lora_plugin float16 \\\n --lora_target_modules \"attn_q\" \"attn_k\" \"attn_v\" \\\n --use_inflight_batching \\\n --paged_kv_cache \\\n --max_lora_rank 8 \\\n --world_size 1 --tp_size 1\n次に、リクエストごとに Triton に渡される LoRA テンソルを生成します。\ngit-lfs clone\nhttps:\/\/huggingface.co\/hfl\/chinese-llama-lora-7b\ngit-lfs clone\nhttps:\/\/huggingface.co\/kunishou\/Japanese-Alpaca-LoRA-7b-v0\npython3 tensorrt_llm\/examples\/hf_lora_convert.py -i Japanese-Alpaca-LoRA-7b-v0 -o Japanese-Alpaca-LoRA-7b-v0-weights --storage-type float16\npython3 tensorrt_llm\/examples\/hf_lora_convert.py -i chinese-llama-lora-7b -o chinese-llama-lora-7b-weights --storage-type float16\nそして、Triton モデル リポジトリを作成し、前述のように Triton サーバーを起動します。\n最後に、クライアントから複数の同時リクエストを発行して multi-LoRA の例を実行します。インフライト バッチャーにより、複数の LoRA が混在するバッチが同じバッチで実行されます。\nINPUT_TEXT=(\"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"美国的首都在哪里? \\n答案:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\" \"アメリカ合衆国の首都はどこですか? \\n答え:\")\nLORA_PATHS=(\"\" \"chinese-llama-lora-7b-weights\" \"Japanese-Alpaca-LoRA-7b-v0-weights\" \"\" \"chinese-llama-lora-7b-weights\" \"Japanese-Alpaca-LoRA-7b-v0-weights\")\n \nfor index in ${!INPUT_TEXT[@]}; do\n text=${INPUT_TEXT[$index]}\n lora_path=${LORA_PATHS[$index]}\n lora_arg=\"\"\n if [ \"${lora_path}\" != \"\" ]; then\n lora_arg=\"--lora-path ${lora_path}\"\n fi\n \n python3 inflight_batcher_llm\/client\/inflight_batcher_llm_client.py \\\n --top-k 0 \\\n --top-p 0.5 \\\n --request-output-len 10 \\\n --text \"${text}\" \\\n --tokenizer-dir \/home\/scratch.trt_llm_data\/llm-models\/llama-models\/llama-7b-hf \\\n ${lora_arg} &\ndone\n \nwait\n出力例を以下に示します。\nInput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901]\nInput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901]\nInput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901]\nInput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901]\nInput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901]\nInput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901]\nGot completed request\nInput: アメリカ合衆国の首都はどこですか? \\n答え:\nOutput beam 0: ワシントン D.C.\nOutput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901, 29871, 31028, 30373, 30203, 30279, 30203, 360, 29889, 29907, 29889]\nGot completed request\nInput: 美国的首都在哪里? \\n答案:\nOutput beam 0: Washington, D.C.\nWhat is the\nOutput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901, 7660, 29892, 360, 29889, 29907, 29889, 13, 5618, 338, 278]\nGot completed request\nInput: 美国的首都在哪里? \\n答案:\nOutput beam 0: Washington D.C.\nWashington D.\nOutput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 139, 29901, 7660, 360, 29889, 29907, 29889, 13, 29956, 7321, 360, 29889]\nGot completed request\nInput: アメリカ合衆国の首都はどこですか? \\n答え:\nOutput beam 0: Washington, D.C.\nWhich of\nOutput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901, 7660, 29892, 360, 29889, 29907, 29889, 13, 8809, 436, 310]\nGot completed request\nInput: アメリカ合衆国の首都はどこですか? \\n答え:\nOutput beam 0: Washington D.C.\n1. ア\nOutput sequence: [1, 29871, 30310, 30604, 30303, 30439, 30733, 235, 164, 137, 30356, 30199, 31688, 30769, 30449, 31250, 30589, 30499, 30427, 30412, 29973, 320, 29876, 234, 176, 151, 30914, 29901, 7660, 360, 29889, 29907, 29889, 13, 29896, 29889, 29871, 30310]\nGot completed request\nInput: 美国的首都在哪里? \\n答案:\nOutput beam 0: 华盛顿\nW\nOutput sequence: [1, 29871, 30630, 30356, 30210, 31688, 30769, 30505, 232, 150, 173, 30755, 29973, 320, 29876, 234, 176, 151, 233, 164, 1\nまとめ\n多くの一般的な LLM アーキテクチャをベースライン サポートする TensorRT-LLM は、さまざまなコード LLM によるデプロイ、実験、最適化を簡単にします。NVIDIA TensorRT-LLM と NVIDIA Triton Inference Server が共に、LLM を効率的に最適化、デプロイ、実行するために不可欠なツールキットを提供します。LoRA でチューニングしたモデルがサポートされる TensorRT-LLM では、カスタマイズされた LLM を効率的にデプロイできるため、メモリ コストと計算コストが大幅に削減されます。\nまずは、\nNVIDIA\/TensorRT-LLM\nオープンソース ライブラリをダウンロードして設定し、さまざまな\nサンプル LLM\nを試してみてください。\nNVIDIA NeMo\nを使用すれば独自の LLM をチューニングできます。例については、「\nNeMo Framework PEFT with Llama2 and Mixtral-8x7B\n」を参照してください。あるいは、\nNeMo Framework Inference Container\nを使用してデプロイすることもできます。\n関連情報\nGTC セッション:\nNeMo、TensorRT-LLM、Triton Inference Server のアクセラレーテッド LLM モデルのアライメントとデプロイ\nGTC セッション:\nOracle Container Engine for Kubernetes を使用し、NVIDIA Nemotron LLM をファインチューニングし、OCI にデプロイする (Oracle 提供)\nGTC セッション:\nテキスト生成に TensorRT-LLM を使用した LLM の最適化とスケーリング\nNGC Containers:\nTensorRT PB May (PB 24h1)\nNGC Containers:\nTensorRT\nSDK:\nNeMo Inferencing Microservice"}