Skip to content

Commit 489a859

Browse files
authored
[TorchAcc] Add USE_TORCH_XLA=0 flag for native swift scripts (#1221)
* add USE_TORCH_XLA=0 flag * remove trim graph
1 parent d6f21c8 commit 489a859

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

examples/pytorch/llm/scripts/torchacc/baichuan2_13b_chat/swift_lora_sft.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
5+
6+
export USE_TORCH_XLA=0
67

78
NPROC_PER_NODE=2 \
89
CUDA_VISIBLE_DEVICES=0,1 \

examples/pytorch/llm/scripts/torchacc/chatglm3_6b/swift_lora_sft.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
6-
# MASTER_PORT=12356 \
5+
export USE_TORCH_XLA=0
6+
77
NPROC_PER_NODE=2 \
88
CUDA_VISIBLE_DEVICES=0,1 \
99
swift sft \

examples/pytorch/llm/scripts/torchacc/llama2_13b_chat/swift_lora_sft.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
5+
export USE_TORCH_XLA=0
66

77
NPROC_PER_NODE=2 \
88
CUDA_VISIBLE_DEVICES=0,1 \

examples/pytorch/llm/scripts/torchacc/llama3_8b_instruct/acc_lora_fsdp_sft.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44
export USE_TORCHACC=1
5-
export TORCHACC_TRIM_GRAPH=1
65
export XLA_IR_SHAPE_CACHE_SIZE=100000000
76
export XLA_ALLOCATOR_FRACTION=0.95
87
export XLA_EXPERIMENTAL=nonzero:masked_select

examples/pytorch/llm/scripts/torchacc/llama3_8b_instruct/swift_lora_sft.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
5+
export USE_TORCH_XLA=0
66

77
NPROC_PER_NODE=2 \
88
CUDA_VISIBLE_DEVICES=0,1 \

examples/pytorch/llm/scripts/torchacc/qwen1half_14b_chat/swift_lora_sft.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
5+
export USE_TORCH_XLA=0
66

77
NPROC_PER_NODE=2 \
88
CUDA_VISIBLE_DEVICES=0,1 \

examples/pytorch/llm/scripts/torchacc/qwen1half_32b_chat/swift_lora_sft.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
5+
export USE_TORCH_XLA=0
66

77
NPROC_PER_NODE=2 \
88
CUDA_VISIBLE_DEVICES=0,1,2,3 \

examples/pytorch/llm/scripts/torchacc/qwen_72b_chat/swift_lora_sft.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
5+
export USE_TORCH_XLA=0
66

7-
NPROC_PER_NODE=1 \
8-
CUDA_VISIBLE_DEVICES=7 \
7+
NPROC_PER_NODE=2 \
8+
CUDA_VISIBLE_DEVICES=0,1,2,3 \
99
swift sft \
1010
--model_id_or_path qwen/Qwen-72B-Chat \
1111
--dataset codefuse-python-en \

examples/pytorch/llm/scripts/torchacc/yi_34b_chat/swift_lora_sft.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 80GB GPU memory
33
# Note: TorchAcc is currently only available internally.
44

5-
# MASTER_ADDR=127.0.0.1 \
5+
export USE_TORCH_XLA=0
66

77
NPROC_PER_NODE=2 \
88
CUDA_VISIBLE_DEVICES=0,1,2,3 \

0 commit comments

Comments
 (0)