René's URL Explorer Experiment


Title: convert-hf-to-ggml.py CUDA out of memory · Issue #35 · bigcode-project/starcoder.cpp · GitHub

Open Graph Title: convert-hf-to-ggml.py CUDA out of memory · Issue #35 · bigcode-project/starcoder.cpp

X Title: convert-hf-to-ggml.py CUDA out of memory · Issue #35 · bigcode-project/starcoder.cpp

Description: i've tried to convert model from HF to GGML format: python3 convert-hf-to-ggml.py ../starcoderbase_int8 and got an error: Loading model: ../starcoderbase_int8 Loading checkpoint shards: ... Traceback (most recent call last): File "/home/...

Open Graph Description: i've tried to convert model from HF to GGML format: python3 convert-hf-to-ggml.py ../starcoderbase_int8 and got an error: Loading model: ../starcoderbase_int8 Loading checkpoint shards: ... Traceba...

X Description: i've tried to convert model from HF to GGML format: python3 convert-hf-to-ggml.py ../starcoderbase_int8 and got an error: Loading model: ../starcoderbase_int8 Loading checkpoint shards: ... Tra...

Opengraph URL: https://github.com/bigcode-project/starcoder.cpp/issues/35

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"convert-hf-to-ggml.py CUDA out of memory","articleBody":"i've tried to convert model from HF to GGML format:\r\n```\r\npython3 convert-hf-to-ggml.py ../starcoderbase_int8\r\n```\r\nand got an error:\r\n```\r\nLoading model:  ../starcoderbase_int8\r\nLoading checkpoint shards:   ...\r\nTraceback (most recent call last):\r\n  File \"/home/alex/starcoder/starcoder.cpp/convert-hf-to-ggml.py\", line 58, in \u003cmodule\u003e\r\n    model = AutoModelForCausalLM.from_pretrained(model_name, config=config, torch_dtype=torch.float16 if use_f16 else torch.float32, low_cpu_mem_usage=True, trust_remote_code=True, offload_state_dict=True)\r\n  File \"/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py\", line 493, in from_pretrained\r\n    return model_class.from_pretrained(\r\n  File \"/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py\", line 2901, in from_pretrained\r\n    ) = cls._load_pretrained_model(\r\n  File \"/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py\", line 3258, in _load_pretrained_model\r\n    new_error_msgs, offload_index, state_dict_index = _load_state_dict_into_meta_model(\r\n  File \"/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py\", line 725, in _load_state_dict_into_meta_model\r\n    set_module_quantized_tensor_to_device(model, param_name, param_device, value=param, fp16_statistics=fp16_statistics)\r\n  File \"/usr/local/lib/python3.10/dist-packages/transformers/utils/bitsandbytes.py\", line 109, in set_module_quantized_tensor_to_device\r\n    new_value = value.to(device)\r\ntorch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 576.00 MiB (GPU 0; 10.90 GiB total capacity; 9.21 GiB already allocated; 568.69 MiB free; 9.74 GiB reserved in total by PyTorch) If reserved memory is \u003e\u003e allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF\r\n```\r\nAnd next I've tried to force it to run on the CPU:\r\n```\r\nexport CUDA_VISIBLE_DEVICES=\"\"\r\npython3 convert-hf-to-ggml.py ../starcoderbase_int8\r\n```\r\nThen, I got this:\r\n```\r\nLoading model:  ../starcoderbase_int8\r\nTraceback (most recent call last):\r\n  File \"/home/alex/starcoder/starcoder.cpp/convert-hf-to-ggml.py\", line 58, in \u003cmodule\u003e\r\n    model = AutoModelForCausalLM.from_pretrained(model_name, config=config, torch_dtype=torch.float16 if use_f16 else torch.float32, low_cpu_mem_usage=True, trust_remote_code=True, offload_state_dict=True)\r\n  File \"/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py\", line 493, in from_pretrained\r\n    return model_class.from_pretrained(\r\n  File \"/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py\", line 2370, in from_pretrained\r\n    raise RuntimeError(\"No GPU found. A GPU is needed for quantization.\")\r\nRuntimeError: No GPU found. A GPU is needed for quantization.\r\n\r\n```\r\nFor me, the main reason to go with GGML implementation is that I can't fit the model in my GPU. I thought I could perform both the conversion and inference using only the CPU and system RAM. Am I doing something specific wrong or I got it wrong in general?","author":{"url":"https://github.com/Alex20129","@type":"Person","name":"Alex20129"},"datePublished":"2024-03-01T08:12:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/35/starcoder.cpp/issues/35"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f0604dc8-c063-abcd-ef65-4e6239e61b2f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA6F2:18CF34:DE774E:135594A:6970C15E
html-safe-nonce72a79c11756b27b9936302a9351c54ebf6e38e3c7082f33c7c27d9fef74b2c1f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkYyOjE4Q0YzNDpERTc3NEU6MTM1NTk0QTo2OTcwQzE1RSIsInZpc2l0b3JfaWQiOiI5MDIwMzQyODg3MjI3OTAwMjU1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb03c63326c03a23039b2d633e1962deda6330e4a31806127b313d704bb2b6fdd
hovercard-subject-tagissue:2162853971
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bigcode-project/starcoder.cpp/35/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9b54fdc734d78266ec27074ff58f714e72ae4a98f69152f902dc289a33f75c18/bigcode-project/starcoder.cpp/issues/35
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9b54fdc734d78266ec27074ff58f714e72ae4a98f69152f902dc289a33f75c18/bigcode-project/starcoder.cpp/issues/35
og:image:alti've tried to convert model from HF to GGML format: python3 convert-hf-to-ggml.py ../starcoderbase_int8 and got an error: Loading model: ../starcoderbase_int8 Loading checkpoint shards: ... Traceba...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAlex20129
hostnamegithub.com
expected-hostnamegithub.com
Nonebb43a7bc61aba1b91c3c5cf8e7d00342e1e77a0cfe55a141222dbd7f9782d26f
turbo-cache-controlno-preview
go-importgithub.com/bigcode-project/starcoder.cpp git https://github.com/bigcode-project/starcoder.cpp.git
octolytics-dimension-user_id110470554
octolytics-dimension-user_loginbigcode-project
octolytics-dimension-repository_id640843237
octolytics-dimension-repository_nwobigcode-project/starcoder.cpp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id640843237
octolytics-dimension-repository_network_root_nwobigcode-project/starcoder.cpp
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release34817b01ad7cdf8b2beb35ea7b0e2a7609004eff
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues/35#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbigcode-project%2Fstarcoder.cpp%2Fissues%2F35
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbigcode-project%2Fstarcoder.cpp%2Fissues%2F35
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=bigcode-project%2Fstarcoder.cpp
Reloadhttps://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues/35
Reloadhttps://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues/35
Reloadhttps://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues/35
bigcode-project https://patch-diff.githubusercontent.com/bigcode-project
starcoder.cpphttps://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fbigcode-project%2Fstarcoder.cpp
Fork 37 https://patch-diff.githubusercontent.com/login?return_to=%2Fbigcode-project%2Fstarcoder.cpp
Star 459 https://patch-diff.githubusercontent.com/login?return_to=%2Fbigcode-project%2Fstarcoder.cpp
Code https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp
Issues 16 https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues
Pull requests 1 https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/pulls
Actions https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/actions
Projects 0 https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/security
Please reload this pagehttps://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues/35
Insights https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/pulse
Code https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp
Issues https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues
Pull requests https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/pulls
Actions https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/actions
Projects https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/projects
Security https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/security
Insights https://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/bigcode-project/starcoder.cpp/issues/35
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/bigcode-project/starcoder.cpp/issues/35
convert-hf-to-ggml.py CUDA out of memoryhttps://patch-diff.githubusercontent.com/bigcode-project/starcoder.cpp/issues/35#top
https://github.com/Alex20129
https://github.com/Alex20129
Alex20129https://github.com/Alex20129
on Mar 1, 2024https://github.com/bigcode-project/starcoder.cpp/issues/35#issue-2162853971
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.