{"id":3538,"date":"2024-03-07T11:27:53","date_gmt":"2024-03-07T03:27:53","guid":{"rendered":"https:\/\/nullthought.net\/?p=3538"},"modified":"2024-11-07T11:01:15","modified_gmt":"2024-11-07T03:01:15","slug":"gemma-cpp","status":"publish","type":"post","link":"https:\/\/nullthought.net\/?p=3538","title":{"rendered":"Gemma.cpp"},"content":{"rendered":"\n<p>Compile and run the <a href=\"https:\/\/github.com\/google\/gemma.cpp\" target=\"_blank\" rel=\"noreferrer noopener\">C++ version of the GEMMA<\/a> LLM(2 billion parameters) on my own laptop. The CPU is maxed out, but it still can&#8217;t produce a single word output after a long time.\ud83d\ude03<\/p>\n\n\n\n<p>\u5728\u81ea\u5df1\u7684\u7b14\u8bb0\u672c\u4e0a\u7f16\u8bd1\u8fd0\u884cC++\u7248gemma\u5927\u6a21\u578b\uff0820\u4ebf\u53c2\u6570\uff09\uff0cCPU\u62c9\u6ee1\uff0c\u4f46\u8fd8\u662f\u534a\u5929\u8e66\u4e0d\u51fa\u4e00\u4e2a\u5355\u8bcd\u8f93\u51fa\u3002\u770b\u6765\u8981\u8003\u8651\u5347\u7ea7\u4e00\u4e0b\u7535\u8111\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"914\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/google-llm_gemma-cpp-1024x914.jpg\" alt=\"\" class=\"wp-image-3539\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/google-llm_gemma-cpp-1024x914.jpg 1024w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/google-llm_gemma-cpp-300x268.jpg 300w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/google-llm_gemma-cpp-768x685.jpg 768w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/google-llm_gemma-cpp.jpg 1104w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Running Gemma.cpp on a laptop<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"356\" height=\"99\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/cpu-maxed-out_running-gemma-cpp.jpg\" alt=\"\" class=\"wp-image-3540\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/cpu-maxed-out_running-gemma-cpp.jpg 356w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/cpu-maxed-out_running-gemma-cpp-300x83.jpg 300w\" sizes=\"auto, (max-width: 356px) 100vw, 356px\" \/><figcaption class=\"wp-element-caption\">CPU is maxed out when running Gemma.cpp on a laptop<\/figcaption><\/figure>\n\n\n\n<p>Pull down the latest codes, compile and run, it&#8217;s OK, great.<\/p>\n\n\n\n<p>\u4e0b\u4e86\u6700\u65b0\u4ee3\u7801\uff0c\u91cd\u65b0\u7f16\u8bd1\u8fd0\u884c\uff0c\u6b63\u5e38\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"728\" src=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/image-1024x728.png\" alt=\"\" class=\"wp-image-3543\" srcset=\"https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/image-1024x728.png 1024w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/image-300x213.png 300w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/image-768x546.png 768w, https:\/\/nullthought.net\/wp-content\/uploads\/2024\/03\/image.png 1385w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Running Gemma.cpp<br>Prompt is &#8220;Variational Autoencoders (VAE) are currently applied in various scenarios, list some.&#8221;, get 476 tokens output in 4.44sec.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Compile and run the C++ version of the GEMMA LLM(2 bill [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[3,8],"tags":[39,86,66],"class_list":["post-3538","post","type-post","status-publish","format-standard","hentry","category-it","category-tech","tag-ai","tag-llm","tag-google"],"rttpg_featured_image_url":null,"rttpg_author":{"display_name":"NullThought","author_link":"https:\/\/nullthought.net\/?author=1"},"rttpg_comment":0,"rttpg_category":"<a href=\"https:\/\/nullthought.net\/?cat=3\" rel=\"category\">IT<\/a> <a href=\"https:\/\/nullthought.net\/?cat=8\" rel=\"category\">Tech<\/a>","rttpg_excerpt":"Compile and run the C++ version of the GEMMA LLM(2 bill&hellip;","_links":{"self":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/3538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3538"}],"version-history":[{"count":2,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/3538\/revisions"}],"predecessor-version":[{"id":3544,"href":"https:\/\/nullthought.net\/index.php?rest_route=\/wp\/v2\/posts\/3538\/revisions\/3544"}],"wp:attachment":[{"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nullthought.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}