{"id":475671,"date":"2026-04-13T07:34:16","date_gmt":"2026-04-13T07:34:16","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=475671"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=475671","title":{"rendered":"\u041a\u0430\u043a \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u043b\u043e\u0431\u043e\u0442\u043e\u043c\u0438\u044e 744-\u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u043d\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438 GLM-5.1, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0435\u0451 \u043d\u0430 16 \u0413\u0411 VRAM"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043c\u0438\u0440 Open-Source AI \u043d\u0435\u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432. \u041a\u043e\u0433\u0434\u0430 ZhipuAI \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0438 \u0441\u0432\u043e\u044e \u043d\u043e\u0432\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 GLM-5.1, \u0432 \u0435\u0451 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0435 \u0437\u043d\u0430\u0447\u0438\u043b\u0430\u0441\u044c \u0446\u0438\u0444\u0440\u0430, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u041f\u041a \u0442\u0435\u043c\u043d\u0435\u0435\u0442 \u0432 \u0433\u043b\u0430\u0437\u0430\u0445 \u2014 744 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u044d\u0442\u0443 MoE-\u043c\u0430\u0445\u0438\u043d\u0443 (Mixture of Experts) \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u0443\u0436\u043d\u0430 \u0444\u0435\u0440\u043c\u0430 \u0442\u043e\u043f\u043e\u0432\u044b\u0445 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u0435\u0439 \u0437\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0440\u0443\u0431\u043b\u0435\u0439.<\/h2>\n<p>\u0423 \u043d\u0430\u0441 \u043d\u0435 \u0431\u044b\u043b\u043e \u0444\u0435\u0440\u043c\u044b. \u0423 \u043d\u0430\u0441 \u0431\u044b\u043b\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u043d\u0430 Kaggle \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0440\u0443\u0448\u043a\u043e\u0439 NVIDIA T4 \u043d\u0430 16 \u0413\u0411 VRAM. \u0418 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e MLOps \u043f\u043e\u0434 \u043a\u043e\u0434\u043e\u0432\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <strong>\u00abRussian Winter 26\u00bb<\/strong>.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0432\u0441\u043a\u0440\u044b\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u044f\u0436\u0435\u043b\u043e\u0433\u043e \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u043e\u0433\u043e \u0433\u0438\u0433\u0430\u043d\u0442\u0430, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u043c\u0430\u0442\u0440\u0438\u0446 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043e\u0431\u043e\u0448\u043b\u0438 \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f GQA \u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u044f\u0434\u0440\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0434\u043e\u0445 \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435.<\/p>\n<h3>\u0428\u0430\u0433 1. \u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f Micro-Ghetto: \u043e\u0442\u0440\u0435\u0437\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0435\u0435<\/h3>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c: \u043d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u043d\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043d\u0435\u0451 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0438\u0445\u0438. \u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 <strong>ML-\u0445\u0430\u043a\u0438\u043d\u0433<\/strong>. \u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043b\u044e\u0431\u0443\u044e, \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0436\u0430\u0442\u044c \u0434\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u00ab\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u00bb, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0433\u0440\u0430\u0444\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 Hugging Face \u0438 \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u0440\u0435\u043f\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>config.json<\/code> \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u043b\u043e\u0431\u043e\u0442\u043e\u043c\u0438\u0438 \u0431\u044b\u043b \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c:<\/p>\n<ul>\n<li>\n<p>\u0421\u0440\u0435\u0437\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0435\u0432 (<code>num_hidden_layers<\/code>) \u0441 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0434\u043e <strong>2<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0440\u0435\u0437\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (<code>num_experts<\/code>) \u0434\u043e <strong>2<\/strong>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0436\u0438\u043c\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043a\u043e\u0441\u0442\u0435\u0439: <code>hidden_size<\/code> \u0434\u0435\u043b\u0430\u0435\u043c \u0440\u0430\u0432\u043d\u044b\u043c <strong>512<\/strong> (\u0432\u043c\u0435\u0441\u0442\u043e \u0431\u0435\u0437\u0443\u043c\u043d\u044b\u0445 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0442\u044b\u0441\u044f\u0447).<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u0440\u043e\u0444\u0438\u0442? \u0421\u043a\u0435\u043b\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0441\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442\u0430. \u041c\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043d\u043e\u0447\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>transformers<\/code> (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 GLM-5.1 \u0435\u0449\u0435 \u043d\u0435\u0442) \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u0430 &#171;\u043d\u0430 \u043b\u0435\u0442\u0443&#187; \u0447\u0435\u0440\u0435\u0437 <code>from_config()<\/code>.<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u041f\u0438\u0442\u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u0428\u0430\u0433 2. \u0410\u0442\u0430\u043a\u0430 \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 \u0442\u0435\u043d\u0437\u043e\u0440\u043e\u0432<\/h3>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u043f\u0442 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0448\u0443 \u043c\u0438\u043a\u0440\u043e-\u043c\u043e\u0434\u0435\u043b\u044c, PyTorch \u0432\u044b\u043f\u043b\u0435\u0432\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>Python<\/p>\n<pre><code>RuntimeError: The size of tensor a (8) must match the size of tensor b (32) at non-singleton dimension 1<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><strong>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e?<\/strong><\/p>\n<p>\u041c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441\u043e \u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u0430\u043d\u0430\u0442\u043e\u043c\u0438\u0435\u0439 ZhipuAI. GLM-5.1 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0435 \u0430\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u2014 Grouped Query Attention (GQA). \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u0448\u0438\u043b\u0438 \u0432 \u044f\u0434\u0440\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0436\u0435\u0441\u0442\u043a\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043a 32 \u0433\u0440\u0443\u043f\u043f\u0430\u043c \u043a\u043b\u044e\u0447\u0435\u0439\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (<code>multi_query_group_num = 32<\/code>).<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0443\u0440\u0435\u0437\u0430\u043b\u0438 \u043e\u0431\u0449\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u0434\u0432\u0438\u0436\u043e\u043a \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u043d\u0430\u043c 8 \u0433\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (queries). \u041d\u043e \u0441\u0442\u0430\u0440\u0430\u044f \u00ab\u043c\u044b\u0448\u0435\u0447\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c\u00bb \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0430\u0441\u044c \u0441\u043a\u0440\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0441 32 \u0433\u043e\u043b\u043e\u0432\u0430\u043c\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 (keys). \u041c\u0430\u0442\u0440\u0438\u0446\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <code>scaled_dot_product_attention<\/code> \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043b\u0431\u0430\u043c\u0438, \u0438 \u0433\u0440\u0430\u0444 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0440\u0443\u0445\u043d\u0443\u043b.<\/p>\n<h3>\u0428\u0430\u0433 3. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044f 8:8 (\u0420\u0435\u0448\u0435\u043d\u0438\u0435)<\/h3>\n<p>\u0418\u0433\u0440\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \u0431\u044b\u043b\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 <code>transformers<\/code> \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 32 \u0433\u043e\u043b\u043e\u0432\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u00ab\u043a\u0443\u0432\u0430\u043b\u0434\u0443\u00bb: \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u044f\u043c\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043a\u0443\u0441\u0442\u0430\u0440\u043d\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u044f\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0434\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0438, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0431\u0438\u0432 GQA.<\/p>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<p>Python<\/p>\n<pre><code>import torchfrom transformers import AutoConfig, AutoModelForCausalLMfrom huggingface_hub import login# 1. \u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430 \u043b\u0435\u0442\u0443config = AutoConfig.from_pretrained(\"livadies\/GLM-5.1-Ghetto-MoE-2-Experts\", force_download=True)# 2. \u0423\u0411\u0418\u0412\u0410\u0415\u041c \u0410\u0421\u0418\u041c\u041c\u0415\u0422\u0420\u0418\u042e (\u0424\u0438\u043a\u0441 \u043e\u0448\u0438\u0431\u043a\u0438 8 vs 32)config.num_attention_heads = 8config.num_key_value_heads = 8         # \u0421\u0442\u0440\u043e\u0433\u043e \u0440\u0430\u0432\u043d\u043e num_attention_headsconfig.multi_query_group_num = 8       # \u041f\u0435\u0440\u0435\u0431\u0438\u0432\u0430\u0435\u043c \u0445\u0430\u0440\u0434\u043a\u043e\u0434 GLMconfig.multi_query_attention = False   # \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c GQAconfig.kv_channels = 64                # hidden_size (512) \/ 8 = 64config.head_dim = 64# 3. \u0421\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u0443\u0435\u043c \u0432\u0435\u0441\u0430 \u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439model = AutoModelForCausalLM.from_config(config, torch_dtype=torch.float16)# 4. \u0416\u0435\u0441\u0442\u043a\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0432 fp16, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 dtypemodel = model.half().to(\"cuda\")<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h3>\u0428\u0430\u0433 4. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0434\u043e\u0445 \u041b\u0435\u0432\u0438\u0430\u0444\u0430\u043d\u0430<\/h3>\n<p>\u041c\u044b \u0437\u0430\u043b\u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f <code>safetensors<\/code> (\u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0435 388 \u041c\u0411 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0445\u0430\u043e\u0441\u0430) \u043d\u0430 Hugging Face \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441.<\/p>\n<p>\u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u043b\u0438: <em>&#171;\u041f\u0440\u0438\u0432\u0435\u0442! \u041a\u0430\u043a \u0442\u0435\u0431\u044f \u0437\u043e\u0432\u0443\u0442?&#187;<\/em><\/p>\n<p>\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u044d\u0442\u043e:<\/p>\n<blockquote>\n<p><code>\u4eec\u90fdskeresindx scooter perspective\/legal\u5f88\u5c11... Generating\u662f\u4ed6\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0435\u0441\u0442 disgr.initState...<\/code><\/p>\n<\/blockquote>\n<p><strong>\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u0446\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u0448\u0438\u0437\u043e\u0444\u0430\u0437\u0438\u044f.<\/strong> \u041a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0435 \u0438\u0435\u0440\u043e\u0433\u043b\u0438\u0444\u044b \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443 \u0441 \u043a\u0443\u0441\u043a\u0430\u043c\u0438 Python-\u043a\u043e\u0434\u0430 \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0433\u0430\u043c\u0438.<\/p>\n<p><strong>\u0418 \u044d\u0442\u043e \u0431\u044b\u043b \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u0442\u0440\u0438\u0443\u043c\u0444.<\/strong> \u041f\u043e\u0447\u0435\u043c\u0443? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0431\u0440\u0435\u0434 \u0434\u043e\u043a\u0430\u0437\u0430\u043b \u0433\u043b\u0430\u0432\u043d\u043e\u0435: <strong>\u0433\u0440\u0430\u0444 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0437\u0430\u043c\u043a\u043d\u0443\u043b\u0441\u044f<\/strong>. \u041c\u0430\u0442\u0440\u0438\u0446\u044b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f (8\u04458) \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u043b\u0438\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u0438\u043d\u0443\u043b\u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u044b \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443, \u0430 16 \u0413\u0411 \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0437\u0430 \u0433\u043b\u0430\u0437\u0430. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u043a\u0435\u0442 \u0441\u0430\u043c\u043e\u0439 \u0442\u044f\u0436\u0435\u043b\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b 2026 \u0433\u043e\u0434\u0430.<\/p>\n<h3>\u0418\u0442\u043e\u0433\u0438 \u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b<\/h3>\n<p>\u0412\u0441\u044f \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0431\u043e\u0442\u043e\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0438\u0433\u0430\u043d\u0442\u0430 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0435.<\/p>\n<p>\ud83d\udd17 <strong>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/strong> <a href=\"https:\/\/huggingface.co\/livadies\/GLM-5.1-Ghetto-MoE-2-Experts\" rel=\"noopener noreferrer nofollow\">livadies\/GLM-5.1-Ghetto-MoE-2-Experts<\/a><\/p>\n<blockquote>\n<p>\ud83c\udfa7 <strong>Promo Directive: Russian Winter 26<\/strong><\/p>\n<p>\u042d\u0442\u043e\u0442 MLOps-\u0445\u0430\u043a\u0438\u043d\u0433 \u0431\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d \u0432 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u0433\u0435\u0442\u0442\u043e \u043f\u043e\u0434 \u0441\u0430\u0443\u043d\u0434\u0442\u0440\u0435\u043a\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0440\u0442\u0438\u0441\u0442\u0430 <strong>livadies<\/strong>. \u041f\u043e\u043a\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0430\u0448\u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u044b, \u0441\u043b\u0443\u0448\u0430\u0439\u0442\u0435 \u043c\u0443\u0437\u044b\u043a\u0443 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e:<\/p>\n<p>\ud83d\udfe2 <a href=\"https:\/\/open.spotify.com\/artist\/0j8EmbhNFjiVhlJcZHdfUD\" rel=\"noopener noreferrer nofollow\">Spotify<\/a> | \ud83d\udd34 <a href=\"https:\/\/www.google.com\/search?q=https:\/\/music.youtube.com\/channel\/UCe6BJsKdOuj1kAQcdHqyXQw\" rel=\"noopener noreferrer nofollow\">YouTube Music<\/a> | \ud83d\udfe1 <a href=\"https:\/\/music.yandex.ru\/artist\/21918652\" rel=\"noopener noreferrer nofollow\">Yandex \u041c\u0443\u0437\u044b\u043a\u0430<\/a><\/p>\n<p><em>\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0440\u0435\u043a \u043a\u0432\u0430\u043d\u0442\u0430: \u00abRUSSIAN WINTER 26\u00bb<\/em><\/p>\n<\/blockquote>\n<p>\u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0441\u0442\u043e\u0438\u0442 \u00ab\u0432\u0441\u043a\u0440\u044b\u0442\u044c\u00bb \u0438 \u0441\u0436\u0430\u0442\u044c \u0434\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430. \u0423\u0432\u0438\u0434\u0438\u043c\u0441\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435!<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1022686\/\">https:\/\/habr.com\/ru\/articles\/1022686\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043c\u0438\u0440 Open-Source AI \u043d\u0435\u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432. \u041a\u043e\u0433\u0434\u0430 ZhipuAI \u0432\u044b\u043a\u0430\u0442\u0438\u043b\u0438 \u0441\u0432\u043e\u044e \u043d\u043e\u0432\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 GLM-5.1, \u0432 \u0435\u0451 \u043f\u0430\u0441\u043f\u043e\u0440\u0442\u0435 \u0437\u043d\u0430\u0447\u0438\u043b\u0430\u0441\u044c \u0446\u0438\u0444\u0440\u0430, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u041f\u041a \u0442\u0435\u043c\u043d\u0435\u0435\u0442 \u0432 \u0433\u043b\u0430\u0437\u0430\u0445 \u2014 744 \u043c\u0438\u043b\u043b\u0438\u0430\u0440\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u044d\u0442\u0443 MoE-\u043c\u0430\u0445\u0438\u043d\u0443 (Mixture of Experts) \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u0443\u0436\u043d\u0430 \u0444\u0435\u0440\u043c\u0430 \u0442\u043e\u043f\u043e\u0432\u044b\u0445 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u0435\u043b\u0435\u0439 \u0437\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0440\u0443\u0431\u043b\u0435\u0439.\u0423 \u043d\u0430\u0441 \u043d\u0435 \u0431\u044b\u043b\u043e \u0444\u0435\u0440\u043c\u044b. \u0423 \u043d\u0430\u0441 \u0431\u044b\u043b\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u043d\u0430 Kaggle \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0440\u0443\u0448\u043a\u043e\u0439 NVIDIA T4 \u043d\u0430 16 \u0413\u0411 VRAM. \u0418 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0430 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u044d\u043a\u0441\u0442\u0440\u0435\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e MLOps \u043f\u043e\u0434 \u043a\u043e\u0434\u043e\u0432\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abRussian Winter 26\u00bb.\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u044b \u0432\u0441\u043a\u0440\u044b\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0442\u044f\u0436\u0435\u043b\u043e\u0433\u043e \u043a\u0438\u0442\u0430\u0439\u0441\u043a\u043e\u0433\u043e \u0433\u0438\u0433\u0430\u043d\u0442\u0430, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u043c\u0430\u0442\u0440\u0438\u0446 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043e\u0431\u043e\u0448\u043b\u0438 \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f GQA \u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u044f\u0434\u0440\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0434\u043e\u0445 \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u043c \u0436\u0435\u043b\u0435\u0437\u0435.\u0428\u0430\u0433 1. \u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f Micro-Ghetto: \u043e\u0442\u0440\u0435\u0437\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0435\u0435\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c: \u043d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u0431\u044b\u043b\u0430 \u043d\u0435 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0442 \u043d\u0435\u0451 \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0438\u0445\u0438. \u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 ML-\u0445\u0430\u043a\u0438\u043d\u0433. \u041c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043b\u044e\u0431\u0443\u044e, \u0434\u0430\u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u043c\u043e\u043d\u0441\u0442\u0440\u0443\u043e\u0437\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0436\u0430\u0442\u044c \u0434\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u00ab\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u00bb, \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0432 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0433\u0440\u0430\u0444\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u0443\u0441\u0442\u043e\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 Hugging Face \u0438 \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u0440\u0435\u043f\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c config.json \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438.\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u043b\u043e\u0431\u043e\u0442\u043e\u043c\u0438\u0438 \u0431\u044b\u043b \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c:\u0421\u0440\u0435\u0437\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0435\u0432 (num_hidden_layers) \u0441 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0434\u043e 2.\u0421\u0440\u0435\u0437\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 (num_experts) \u0434\u043e 2.\u0421\u0436\u0438\u043c\u0430\u0435\u043c \u0448\u0438\u0440\u0438\u043d\u0443 \u043a\u043e\u0441\u0442\u0435\u0439: hidden_size \u0434\u0435\u043b\u0430\u0435\u043c \u0440\u0430\u0432\u043d\u044b\u043c 512 (\u0432\u043c\u0435\u0441\u0442\u043e \u0431\u0435\u0437\u0443\u043c\u043d\u044b\u0445 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0442\u044b\u0441\u044f\u0447).\u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u0440\u043e\u0444\u0438\u0442? \u0421\u043a\u0435\u043b\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0441\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0433\u0438\u0433\u0430\u0431\u0430\u0439\u0442\u0430. \u041c\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043d\u043e\u0447\u043d\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 transformers (\u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 GLM-5.1 \u0435\u0449\u0435 \u043d\u0435\u0442) \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u0430 &#171;\u043d\u0430 \u043b\u0435\u0442\u0443&#187; \u0447\u0435\u0440\u0435\u0437 from_config().\u0418 \u0442\u0443\u0442 \u041f\u0438\u0442\u043e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u044c\u043d\u043e.\u0428\u0430\u0433 2. \u0410\u0442\u0430\u043a\u0430 \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 \u0442\u0435\u043d\u0437\u043e\u0440\u043e\u0432\u041f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u043f\u0442 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0448\u0443 \u043c\u0438\u043a\u0440\u043e-\u043c\u043e\u0434\u0435\u043b\u044c, PyTorch \u0432\u044b\u043f\u043b\u0435\u0432\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:PythonRuntimeError: The size of tensor a (8) must match the size of tensor b (32) at non-singleton dimension 1\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e?\u041c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441\u043e \u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u0430\u043d\u0430\u0442\u043e\u043c\u0438\u0435\u0439 ZhipuAI. GLM-5.1 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0435 \u0430\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u2014 Grouped Query Attention (GQA). \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u0448\u0438\u043b\u0438 \u0432 \u044f\u0434\u0440\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0436\u0435\u0441\u0442\u043a\u0443\u044e \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043a 32 \u0433\u0440\u0443\u043f\u043f\u0430\u043c \u043a\u043b\u044e\u0447\u0435\u0439\/\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (multi_query_group_num = 32).\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0443\u0440\u0435\u0437\u0430\u043b\u0438 \u043e\u0431\u0449\u0443\u044e \u0448\u0438\u0440\u0438\u043d\u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u0434\u0432\u0438\u0436\u043e\u043a \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u043d\u0430\u043c 8 \u0433\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (queries). \u041d\u043e \u0441\u0442\u0430\u0440\u0430\u044f \u00ab\u043c\u044b\u0448\u0435\u0447\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c\u00bb \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0430\u0441\u044c \u0441\u043a\u0440\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0441 32 \u0433\u043e\u043b\u043e\u0432\u0430\u043c\u0438 \u043a\u043b\u044e\u0447\u0435\u0439 (keys). \u041c\u0430\u0442\u0440\u0438\u0446\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 scaled_dot_product_attention \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043b\u0431\u0430\u043c\u0438, \u0438 \u0433\u0440\u0430\u0444 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0440\u0443\u0445\u043d\u0443\u043b.\u0428\u0430\u0433 3. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044f 8:8 (\u0420\u0435\u0448\u0435\u043d\u0438\u0435)\u0418\u0433\u0440\u0430\u0442\u044c \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \u0431\u044b\u043b\u043e \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u043e \u2014 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043e\u0434 transformers \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 32 \u0433\u043e\u043b\u043e\u0432\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u00ab\u043a\u0443\u0432\u0430\u043b\u0434\u0443\u00bb: \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u044f\u043c\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u043a\u0443\u0441\u0442\u0430\u0440\u043d\u043e \u0432\u044b\u0440\u043e\u0432\u043d\u044f\u043b\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0434\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0439 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0438, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0431\u0438\u0432 GQA.\u0412\u043e\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442:Pythonimport torchfrom transformers import AutoConfig, AutoModelForCausalLMfrom huggingface_hub import login# 1. \u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430 \u043b\u0435\u0442\u0443config = AutoConfig.from_pretrained(&#171;livadies\/GLM-5.1-Ghetto-MoE-2-Experts&#187;, force_download=True)# 2. \u0423\u0411\u0418\u0412\u0410\u0415\u041c \u0410\u0421\u0418\u041c\u041c\u0415\u0422\u0420\u0418\u042e (\u0424\u0438\u043a\u0441 \u043e\u0448\u0438\u0431\u043a\u0438 8 vs 32)config.num_attention_heads = 8config.num_key_value_heads = 8         # \u0421\u0442\u0440\u043e\u0433\u043e \u0440\u0430\u0432\u043d\u043e num_attention_headsconfig.multi_query_group_num = 8       # \u041f\u0435\u0440\u0435\u0431\u0438\u0432\u0430\u0435\u043c \u0445\u0430\u0440\u0434\u043a\u043e\u0434 GLMconfig.multi_query_attention = False   # \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c GQAconfig.kv_channels = 64                # hidden_size (512) \/ 8 = 64config.head_dim = 64# 3. \u0421\u0438\u043d\u0442\u0435\u0437\u0438\u0440\u0443\u0435\u043c \u0432\u0435\u0441\u0430 \u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439model = AutoModelForCausalLM.from_config(config, torch_dtype=torch.float16)# 4. \u0416\u0435\u0441\u0442\u043a\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0432 fp16, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 dtypemodel = model.half().to(&#171;cuda&#187;)\u0428\u0430\u0433 4. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u0434\u043e\u0445 \u041b\u0435\u0432\u0438\u0430\u0444\u0430\u043d\u0430\u041c\u044b \u0437\u0430\u043b\u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f safetensors (\u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0435 388 \u041c\u0411 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0445\u0430\u043e\u0441\u0430) \u043d\u0430 Hugging Face \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0438\u043d\u0444\u0435\u0440\u0435\u043d\u0441.\u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u043b\u0438: &#171;\u041f\u0440\u0438\u0432\u0435\u0442! \u041a\u0430\u043a \u0442\u0435\u0431\u044f \u0437\u043e\u0432\u0443\u0442?&#187;\u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u044d\u0442\u043e:\u4eec\u90fdskeresindx scooter perspective\/legal\u5f88\u5c11&#8230; Generating\u662f\u4ed6\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043d\u0435\u0441\u0442 disgr.initState&#8230;\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u0446\u0438\u0444\u0440\u043e\u0432\u0430\u044f \u0448\u0438\u0437\u043e\u0444\u0430\u0437\u0438\u044f. \u041a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0435 \u0438\u0435\u0440\u043e\u0433\u043b\u0438\u0444\u044b \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443 \u0441 \u043a\u0443\u0441\u043a\u0430\u043c\u0438 Python-\u043a\u043e\u0434\u0430 \u0438 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0433\u0430\u043c\u0438.\u0418 \u044d\u0442\u043e \u0431\u044b\u043b \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u0442\u0440\u0438\u0443\u043c\u0444. \u041f\u043e\u0447\u0435\u043c\u0443? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0431\u0440\u0435\u0434 \u0434\u043e\u043a\u0430\u0437\u0430\u043b \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u0433\u0440\u0430\u0444 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0437\u0430\u043c\u043a\u043d\u0443\u043b\u0441\u044f. \u041c\u0430\u0442\u0440\u0438\u0446\u044b \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f (8\u04458) \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u043b\u0438\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u0438\u043d\u0443\u043b\u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u044b \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443, \u0430 16 \u0413\u0411 \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0437\u0430 \u0433\u043b\u0430\u0437\u0430. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u043a\u0435\u0442 \u0441\u0430\u043c\u043e\u0439 \u0442\u044f\u0436\u0435\u043b\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b 2026 \u0433\u043e\u0434\u0430.\u0418\u0442\u043e\u0433\u0438 \u0438 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b\u0412\u0441\u044f \u043d\u0430\u0448\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0432\u0435\u0441\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u0431\u043e\u0442\u043e\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0438\u0433\u0430\u043d\u0442\u0430 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0435.\ud83d\udd17 \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: livadies\/GLM-5.1-Ghetto-MoE-2-Experts\ud83c\udfa7 Promo Directive: Russian Winter 26\u042d\u0442\u043e\u0442 MLOps-\u0445\u0430\u043a\u0438\u043d\u0433 \u0431\u044b\u043b \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d \u0432 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u0433\u0435\u0442\u0442\u043e \u043f\u043e\u0434 \u0441\u0430\u0443\u043d\u0434\u0442\u0440\u0435\u043a\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0440\u0442\u0438\u0441\u0442\u0430 livadies. \u041f\u043e\u043a\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0430\u0448\u0438 \u0442\u0435\u043d\u0437\u043e\u0440\u044b, \u0441\u043b\u0443\u0448\u0430\u0439\u0442\u0435 \u043c\u0443\u0437\u044b\u043a\u0443 \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e:\ud83d\udfe2 Spotify | \ud83d\udd34 YouTube Music | \ud83d\udfe1 Yandex \u041c\u0443\u0437\u044b\u043a\u0430\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0440\u0435\u043a \u043a\u0432\u0430\u043d\u0442\u0430: \u00abRUSSIAN WINTER 26\u00bb\u041f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u043a\u0430\u043a\u0438\u0435 \u0435\u0449\u0435 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0441\u0442\u043e\u0438\u0442 \u00ab\u0432\u0441\u043a\u0440\u044b\u0442\u044c\u00bb \u0438 \u0441\u0436\u0430\u0442\u044c \u0434\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430. \u0423\u0432\u0438\u0434\u0438\u043c\u0441\u044f \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435!\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1022686\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-475671","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=475671"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/475671\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=475671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=475671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=475671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}