{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/flexllm-a-system-for-co-serving-large","title":"FlexLLM: A System for Co-Serving Large Language Model Inference and Parameter-Efficient Finetuning","arxiv_id":"2402.18789","date":"2024-02-29","proceeding":null,"authors":["Gabriele Oliaro","Xupeng Miao","Xinhao Cheng","Vineeth Kada","Ruohan Gao","Yingyi Huang","Remi Delacourt","April Yang","Yingcheng Wang","Mengdi Wu","Colin Unger","Zhihao Jia"],"abstract":"Finetuning large language models (LLMs) is essential for task adaptation, yet serving stacks today isolate inference and finetuning on separate GPU clusters -- wasting resources and under-utilizing hardware. We introduce FlexLLM, the first system to co-serve LLM inference and PEFT-based finetuning on shared GPUs by fusing computation at the token level. The static compilation optimizations in FlexLLM -- dependent parallelization and graph pruning significantly shrink activation memory, leading to end-to-end GPU memory savings by up to 80%. At runtime, a novel token-level finetuning mechanism paired with a hybrid token scheduler dynamically interleaves inference and training tokens within each co-serving iteration, meeting strict latency SLOs while maximizing utilization. In end-to-end benchmarks on LLaMA-3.1-8B, Qwen-2.5-14B, and Qwen-2.5-32B, FlexLLM sustains the inference SLO requirements up to 20 req/s, and improves finetuning throughput by 1.9-4.8x under heavy inference workloads and 2.5-6.8x under light loads, preserving over 76% of peak finetuning progress even at peak demand. The source code of FlexLLM is publicly available at https://github.com/flexflow/FlexFlow/.","url_abs":"https://arxiv.org/abs/2402.18789v2","url_pdf":"https://arxiv.org/pdf/2402.18789v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"flexllm-a-system-for-co-serving-large","repo_url":"https://github.com/flexflow/flexflow","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"GPU"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.18789","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.18789"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/flexflow/flexflow","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":5,"unverified":3},"by_repo_kind":{"official":{"samples":8,"ran":5,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"a2d1b8f9edbbfb81","entry":"enum_to_int","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow/type.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow/type.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a2d1b8f9edbbfb81"}},{"code_sha256_prefix":"7dd498a51acceb8d","entry":"enum_to_str","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow/type.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow/type.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7dd498a51acceb8d"}},{"code_sha256_prefix":"b677c2a800aac1fc","entry":"find_flexflow_header","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow_cffi_build.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow_cffi_build.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b677c2a800aac1fc"}},{"code_sha256_prefix":"e82939d02bac3723","entry":"int_to_enum","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow/type.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow/type.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e82939d02bac3723"}},{"code_sha256_prefix":"66e8b9c310140433","entry":"setup_custom_logger","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow/core/flexflow_logger.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow/core/flexflow_logger.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"66e8b9c310140433"}},{"code_sha256_prefix":"f37ec99aba28636f","entry":"get_c_name","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow/core/flexflow_cffi.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow/core/flexflow_cffi.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f37ec99aba28636f"}},{"code_sha256_prefix":"d3251c2f4e4010d2","entry":"input_args","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow/core/flexflow_top.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow/core/flexflow_top.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d3251c2f4e4010d2"}},{"code_sha256_prefix":"b03e8560f708a347","entry":"run_flexflow","repo":"flexflow/flexflow","repo_kind":"official","path":"bindings/python/old/flexflow/driver.py","file_url":"https://github.com/flexflow/flexflow/blob/HEAD/bindings/python/old/flexflow/driver.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b03e8560f708a347"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}